Skip to content
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

Auto-resolve shift/reduce conflicts involving the catch token #327

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

sgraf812
Copy link
Collaborator

@sgraf812 sgraf812 commented Nov 6, 2024

When the current token is the catch token, we never reduce; we only ever shift (see the user's guide for how catch works). More precisely, the mechanism considers multiple situations in which the catch token can be shifted in parallel, including situations that are reachable via reductions. Hence it does not make sense to report shift/reduce conflicts involving the catch token: Error resumption mode will only ever try to shift it.

The solution implemented in this patch is not to generate conflicting LR'Reduce actions in the first place by deleting the catch token from the lookahead sets of LR1 items.

When the current token is the catch token, we never reduce; we only ever
shift. Hence it does not make sense to report shift/reduce conflicts
involving the catch token: Error resumption mode will only ever try to
shift it.

The solution implemented in this patch is not to generate conflicting
LR'Reduce actions in the first place by deleting the catch token from
the lookahead sets of LR1 items.
@sgraf812 sgraf812 merged commit 27fb1cc into master Nov 8, 2024
26 checks passed
@Ericson2314 Ericson2314 deleted the wip/catch-no-shift-reduce branch November 8, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants