Hi Greg

> Parslet parsers are impacted negatively by whitespace in various ways.
> Reading over the Parslet examples and the Capuchin parser, you can see
> "space?" and "sp?" littered throughout the code. The number of places
> where whitespace is not allowed are fairly rare, so the majority of
> rules contain some mention of it. Even the JSON parser example has
> frequent mentions of optional space, which you don't see in other
> grammar formats.
>
> I don't have a specific proposal. Perhaps optional skipping whitespace
> like pyPEG does is best. However, it does seem like two operators
> "join with any space" (maybe +?) and "join without space" (currently
>>> ) would make things easier, provided that str('a')+str('b').maybe
> did not eat the whitespace if 'b' didn't match.

I guess I don't feel the way you do on this issue at all. I've been 
improving on meta-programmability of parser construction - the solution 
to ugliness in parsers IMHO. But that is just me.

How about the following: Create a non-invasive patch that allows this 
'white-space-ignoring-join' and propose it to us - I might just accept 
it, provided the code fits to parslets style.

Who am I to tell you how to construct parsers?

best regards,
kaspar

Reply via email to