lib/rird/blocks/compiler.rb
def compile_dlist(list_tag, lexer)
        first = lexer.peek
        items = []
        loop do
          term_line = lexer.read
          break if term_line.tag == :eof
          unless term_line.lead_space.size == first.lead_space.size && term_line.tag == list_tag
            lexer.unread term_line
            break
          end
          inner = inner_indent(term_line)
          term  = term_line.string[inner.size..-1]
          desc  = compile_blocks(lexer, nil){|line|
            line.tag == list_tag && line.lead_space.size == term_line.lead_space.size
          }
          items << [term, desc]
        end
        {list_tag => {line: first.lineno, items: items.compact}}
      end
# FIXME: must skip trailing comment and whiteline after term or desc
must skip trailing comment and whiteline after term or desc
must skip trailing comment and whiteline after term or desc
def compile_dlist(list_tag, lexer)
        first = lexer.peek
        items = []
        loop do
          term_line = lexer.read
          break if term_line.tag == :eof
          unless term_line.lead_space.size == first.lead_space.size && term_line.tag == list_tag
            lexer.unread term_line
            break
          end
          inner = inner_indent(term_line)
          term  = term_line.string[inner.size..-1]
          desc  = compile_blocks(lexer, nil){|line|
            line.tag == list_tag && line.lead_space.size == term_line.lead_space.size
          }
          items << [term, desc]
        end
        {list_tag => {line: first.lineno, items: items.compact}}
      end
def compile_dlist ( list_tag , lexer ) first = lexer . peek items = [ ] loop do term_line = lexer . read break if term_line . tag == :eof unless term_line . lead_space . size == first . lead_space . size && term_line . tag == list_tag lexer . unread term_line break end inner = inner_indent ( term_line ) term = term_line . string [ inner . size .. - 1 ] desc = compile_blocks ( lexer , nil ) { | line | line . tag == list_tag && line . lead_space . size == term_line . lead_space . size } items << [ term , desc ] end { list_tag => { line : first . lineno , items : items . compact } } end
FIXME: must skip trailing comment and whiteline after term or desc
FIXME : must skip trailing comment and whiteline after term or desc
list_tag
lexer