Am 25.06.2011 um 15:57 schrieb Sean P. DeNigris:
Is there a way to do something like:
#digit asParser, 'same digit that I just parsed' asParser ?
I'm not sure if there is a possibility in declarative way. But you can work on
the products of the individual parsers. You can do it like this:
twoEqualDigits
^ #digit asParser, #digit asParser ==> [:nodes|
(nodes first = nodes second)
ifTrue: [ nodes ]
ifFalse: [ PPFailure message: 'not the same value' at: 0]]
I snooped around and saw PPMemoizedParser, but
didn't exactly understand the
test for it.
I would like to know exactly, too :)
Norbert