kschiess / parslet

A small PEG based parser library. See the Hacking page in the Wiki as well.
kschiess.github.com/parslet
MIT License
805 stars 95 forks source link

#parse function will never return #143

Closed eeeyes closed 8 years ago

eeeyes commented 9 years ago

when you call parse function like this 'Parslet::str('a').maybe.repeat(1).parse('a')' , then the parse function will never return.

rubydesign commented 9 years ago

@eeeyes I think the syntax wobbled a bit (no rule, no input), but maybe i know what you mean: Peg parsers don't do left recursion. You can try an read up about it. Usually (i think in theory always) there there is a way to transform the grammar so that left recursion doesn't happen. You should probably close the issue (as it is not parslets fault) , though i don't mind if you ask more questions. There is a mailing list for this kind of thing, but admittedly it's clumsy.

kschiess commented 8 years ago

This says:

an endless loop. Parslet's behaviour is correct.