Attempt error recovery for no-matches as well#594
Closed
Xanewok wants to merge 1 commit intoNomicFoundation:mainfrom
Closed
Attempt error recovery for no-matches as well#594Xanewok wants to merge 1 commit intoNomicFoundation:mainfrom
Xanewok wants to merge 1 commit intoNomicFoundation:mainfrom
Conversation
|
This relies on using almost entirely skipped parse rules to stop at terminators such ';' in the contract members list. In the future, we'd need to expand the recovery boundary token set and handle that appropriately ourselves.
1cea903 to
fd9359b
Compare
Contributor
Author
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 27, 2023
…inside (#601) Simpler variant of #594. While writing an issue for the potential null parse recovery, it just hit me that we might not need to support that generally but rather just limiting that to the delimited group would give us enough bang for the buck. TerminatedBy null parse recovery can be a bit too greedy, i.e. we might recover some unexpected item definition just because... we recovered at the final terminator. However, the delimited group is a reasonable boundary since it's simple (2-3 kinds of general delimiters versus different kinds of potentially versioned terminated statements) and the opening delimiter must always match the closing one, so it produces more reliable and self-contained recovered phrases, hence attempting to recover from a null parse in a delimited group makes more sense.
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.
Based on #586.
This relies on using almost entirely skipped parse rules to stop at
terminators such ';' in the contract members list. In the future,
we'd need to expand the recovery boundary token set and handle that
appropriately ourselves.