-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite loop (or similar) in parser #17
Comments
yep, using a rule that can match the empty string inside a star expression will do that. more succinctly:
|
Shouldn't this be caught? I mean, isn't part of the point of parsley to have nice error messages... an infinite loop isn't very nice. |
That'd be nice. There's probably even a way to detect some cases of this statically. |
This also causes an infinite loop: |
Yes. Repeating any rule that will match an empty string will loop forever. |
so wouldn't it be possible to check a rule to see if it matches the empty string before building it into a star expression? seems like a relatively cheap operation which'd prevent a common error. |
The following code will make parsley take 100% CPU and slowly growing in memory for a long long time. This is an incorrect grammar because the rule "output" is referencing "one" directly AND indirectly via the rule "number". It would be better if parsley detected this and threw a helpful error.
The text was updated successfully, but these errors were encountered: