-
-
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
Breaking change between 2.1 and 2.4/2.5 #762
Comments
It may be a side-effect of some optimization work that has been done since 2.1, e.g. #473 ? |
@vincent-herlemont I managed to reproduce it. I tried @SkiFire13 @dragostis @CAD97 do you have any suggestions on how to proceed here -- should that optimization be reverted, or should it stay as it is and @vincent-herlemont could rewrite that grammar in some way (I guess one dummy workaround is to introduce extra rules, so that the optimization fails to be applied), or can you see an easy way to restrict that optimization? |
Transforming With the implied whitespace made explicit, it's transforming @{ a ~ WHITESPACE* ~ b | a }
// to
@{ a ~ WHITESPACE* ~ b? }
// which is incorrect, it should be
@{ a ~ (WHITESPACE* ~ b)? } Probably the "correct" fix is to "desugar" all of the implicit whitespace rules before applying any optimization transformations. |
…ules closes pest-parser#762 the full fix would require a bigger overhaul / refactoring of the optimizer
made a quick fix in #766
|
@tomtau Thanks for the fix :) ! |
Describe the bug
During this discussion Implicit expression · #761 I have discovered that there is a difference of behavior for the following syntax between pest 2.1 and pest 2.4/2.5, for now I don't know if it's the expected behavior or not. I open an issue to know how to decide this.
To Reproduce
For the following grammar:
The input
a a
return this error for pest 2.4/2.5 ❌ :Success for 2.1 ✔️
Expected behavior
Run without error and return two
array
.The text was updated successfully, but these errors were encountered: