[Pharo-project] PetitParser puzzle

Damien Pollet damien.pollet at gmail.com
Sat May 7 20:06:10 CEST 2011

On 6 May 2011 19:13, Norbert Hartl <norbert at hartl.name> wrote:
> Here you test if the parser can consume all of the string. But it different to the situation if the parser succeeds. A star parser always succeeds. And the operator / only matches of the parser on the left side couldn't succeed. In the "line" case the lineBlank succeeds thus the right one is not tried.

Hmm, indeed, hadn't thought of that. Swapping the / sides makes it work.

> So no characters are consumed and the test fails because it does not parse. That was what first came to my mind but then I thought this might be just a hack to reverse the order of ther parser. But my initial mail was right. The more specific parser should go before to all matching parser.

OK, makes sense. Thanks!

Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet

More information about the Pharo-project mailing list