Allow %empty followed by %prec#538
Merged
ltratt merged 1 commit intosoftdevteam:masterfrom Mar 22, 2025
Merged
Conversation
Member
|
I think this is an improvement, even though I'm sure we could improve things further again. |
Collaborator
Author
|
Needed a rustfmt (Should I just automatically squash for changes like this?). |
Member
|
Yes for small changes like this, please feel free to squash directly (but don't rebase because the makes the |
70f1b94 to
ecb81c1
Compare
Collaborator
Author
|
Squashed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If one applies the following patch to the grammar in the zip archive linked from #473
to uncomment the
%precdirectives, and run the file through nimbleparse.You currently get an error "%empty used in non-empty production".
This relaxes that error message so that
%precis accepted after%empty.in #453 there was also a question about whether
%prec xshould be accepted without quotes around'x'.I believe that the usage of
%prec Ophere seems to confirm that.I wasn't able to test this with the provided input.txt, the lexer seems to be missing the necessary tokens.
but with this change I was able to run the modified grammar over the empty string. Producing an empty parse tree.