Duplicate string argument to token parser.

This commit is contained in:
Jakob Rath 2013-11-15 14:49:18 +01:00 committed by Dan Hirsch
parent 7bdd8b7ce2
commit 3f661b91e3
2 changed files with 13 additions and 4 deletions

View file

@ -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