Class: HParser::Util::Many1

Inherits:
Object
  • Object
show all
Defined in:
lib/hparser/util/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(parser) ⇒ Many1

Returns a new instance of Many1.



4
5
6
# File 'lib/hparser/util/parser.rb', line 4

def initialize(parser)
  @parser = parser
end

Instance Method Details

#parse(*args) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/hparser/util/parser.rb', line 8

def parse(*args)
  result = []
  while (r = @parser.parse(*args))
    result.push r
  end
  result==[] ? nil : result
end