I've been playing with PetitParser and I keep running into what seems like a
common case. I want to skip everything up to the first match of my second
parser.
For example, if I don't care about anything in a string that comes before
'dd', I write:
parser2 := 'dd' asParser negate plus, 'dd' asParser ==> [ :nodes |
nodes
second ].
parser2 parse: 'kslkxjclkxjcdd'. "Returns 'dd'"
This gets the job done, but seems awkward. What's the most elegant way?
I thought maybe "'dd' asParser not plus, 'dd' asParser."
But the image just hangs.
Thanks.
Sean
--
View this message in context:
http://forum.world.st/PetitParser-skip-everything-up-to-X-tp3038824p3038824…
Sent from the Moose mailing list archive at
Nabble.com.