-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
[BUG] Pest.rs hangs indefinitely with this grammar #571
Comments
@matthew-dean I think it is because of this:
In Pest, the whitespace is supposed to be just a character, not a sequence of them.
I think removing the |
@ancientstraits Oh, it auto-consumes multiples of that token between other tokens? 🤔 |
Yes, when you define IIRC we have a safeguard against this for normal rules, but apparently |
@CAD97 Guess we need to add in that safeguard then. I will try to see where to look to add that safeguard |
It's at this line. Line 341 in 525ba7b
WHITESPACE .
|
This specific exemple of a grammar causing the parser to hang indefinitely was fixed in #848, although there are still cases not covered. |
The existence of an additional match after
ident_token
will causequalified_rule
to hang when typing, as well as any rule which includesqualified_rule
, such asroot
. Even though selectingident_token
from the drop-down on Pest.rs does not hang when typing. I haven't tried the Rust integration yet as I'm still crafting grammar. Is there any reason to expect the Rust part would work when Pest.rs fails / hangs like this?Note: I tried to reduce this to just
qualified_rule
, and only the rules referenced. But, when I did that, the grammar actually succeeded and didn't freeze the site. So, somehow there's an invisible interaction with other rules that are not referenced? 🤔The text was updated successfully, but these errors were encountered: