You can’t must prevent your repetition (+) from eating too much.
PEG parsers never backtrack on input that has been matched,
only on whole rules. One way to prevent that is the following:
rule question
( !following repeatable )+ following
end
rule following
‘?’
end
rule repeatable
.
end
(obviously you can redefine repeatable and following to match any
content)
Clifford Heath.
> --
> You received this message because you are subscribed to the Google Groups "Treetop Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
treetop-dev...@googlegroups.com.
> To post to this group, send email to
treet...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/treetop-dev.
> For more options, visit
https://groups.google.com/d/optout.