regex - Non-greedy matching in Treetop/PEG? -
How do I do something like this in the trip? It seems that the only way to do this is:
[ ^;] + ';'
What kind of ugly is there any other way? . +?
does not seem to work.
Peg is greedy blind by default , It means that they can eat as much as they can input and they do not believe what happens next:
S & lt; - P1 * P2
(greedy, blind)
It can be decided that the order can be decided using the option (and without the use of the hideheads):
S & lt; - P1 S / P2
(lazy, non-blind)
S & lt; - P2 / P1S
(lazy, non-blind)
Comments
Post a Comment