Thanks Kaspar,

That makes sense. 

The error is not in the documentation, it is in the Slide Presentation linked 
on the Documentation page, by Bo Jeanes and David Pick on Slide 16.

So, no way to fix it unless they can correct the presentation.

thanks
joey

Presentations

Parslet, An Introduction introduces parslet in a few poignant slides. (Bo 
Jeanes and David Pick)

On Sep 23, 2012, at 7:00 AM, Kaspar Schiess wrote:

> Hi Joey,
> 
> Yes, precedence does matter. (to answer your subject first)
> 
> In fact, if you have an alternative between a parser that is easy to
> satisfy (integer, say with the string '13') and a parser that is more
> demanding (decimal, consuming '.2432' as well), the order does matter a
> lot. Parslet (PEG parsers) will try alternatives from left to right
> strictly, without magic. Once something can be matched, the alternative
> is considered matched.
> 
> In your case, that would mean that the :number-rule always matches the
> integer prefix of any decimal. No decimal can ever be matched with your
> parser.
> 
> And finally: If that is on the website now, I am sure the input given is
> always integer ;) Because it has never worked. It is a bug in
> documentation (the worst kind of bugs). Would you care to correct it and
> send me a patch?
> 
> regards,
> kaspar
> 

Reply via email to