Duplicate string argument to token parser.
This commit is contained in:
parent
7bdd8b7ce2
commit
3f661b91e3
2 changed files with 13 additions and 4 deletions
|
|
@ -52,3 +52,9 @@ p parser.parse 'Hello Mom!'
|
|||
h = Hammer::Parser
|
||||
parser = h.sequence(h.token('Hello '), h.choice(h.token('Mom'), h.token('Dad')), h.token('!'))
|
||||
p parser.parse 'Hello Mom!'
|
||||
|
||||
s = 'blah'
|
||||
parser = h.token(s)
|
||||
p parser.parse 'BLAH' # => false
|
||||
s.upcase!
|
||||
p parser.parse 'BLAH' # => false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue