Add Parser.build_choice method.
This commit is contained in:
parent
d3ff5f5b1e
commit
676799fbbc
1 changed files with 5 additions and 2 deletions
|
|
@ -9,9 +9,12 @@ module Hammer
|
|||
def self.build(&block)
|
||||
ParserBuilder.new.sequence(&block).build
|
||||
end
|
||||
end
|
||||
|
||||
# TODO: Is this even useful for "real" usage?
|
||||
def self.build_choice(&block)
|
||||
ParserBuilder.new.choice(&block).build
|
||||
end
|
||||
end # class Parser
|
||||
|
||||
class ParserBuilder
|
||||
attr_reader :parsers
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue