Class: MDOM::InlineParser::Scanner

Inherits:
Object
  • Object
show all
Defined in:
lib/mdom/inline_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Scanner

Returns a new instance of Scanner.



22
23
24
25
26
# File 'lib/mdom/inline_parser.rb', line 22

def initialize(text)
  @text = text
  @len = text.length
  @pos = 0
end

Instance Method Details

#read_nodesObject



28
29
30
31
32
33
34
35
# File 'lib/mdom/inline_parser.rb', line 28

def read_nodes
  nodes = []
  while @pos < @len
    node = read_node
    nodes << node if node
  end
  nodes
end