Method: Asciidoctor::Parser.parse_blocks

Defined in:
lib/asciidoctor/parser.rb

.parse_blocks(reader, parent, attributes = nil) ⇒ void

This method returns an undefined value.

Parse blocks from this reader until there are no more lines.

This method calls Parser#next_block until there are no more lines in the Reader. It does not consider sections because it’s assumed the Reader only has lines which are within a delimited block region.

Parameters:

  • reader

    The Reader containing the lines to process

  • parent

    The parent Block to which to attach the parsed blocks



1095
1096
1097
1098
1099
1100
1101
1102
# File 'lib/asciidoctor/parser.rb', line 1095

def self.parse_blocks(reader, parent, attributes = nil)
  if attributes
    while ((block = next_block reader, parent, attributes.merge) && parent.blocks << block) || reader.has_more_lines?; end
  else
    while ((block = next_block reader, parent) && parent.blocks << block) || reader.has_more_lines?; end
  end
  nil
end