Skip to content

Improve grammar parser error recovery around malformed productions#79

Merged
ehwan merged 3 commits into
mainfrom
error_token_in_parser
Jun 21, 2026
Merged

Improve grammar parser error recovery around malformed productions#79
ehwan merged 3 commits into
mainfrom
error_token_in_parser

Conversation

@ehwan

@ehwan ehwan commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add targeted error recovery productions for malformed rule bodies, symbol bindings, terminal sets, reduce actions, and %allow targets.
  • Propagate precedence declarations for the reserved error terminal into the core parser builder.
  • Document that error can participate in precedence declarations for recovery-related conflict resolution.
  • Add parser tests covering the new recovery paths and regenerate the bootstrapped parser output.

@ehwan ehwan self-assigned this Jun 21, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for using the reserved error terminal in precedence declarations to resolve shift/reduce conflicts from panic-mode recovery productions. It updates the parser rules to handle malformed inputs gracefully, adds corresponding unit tests, and updates the documentation. Feedback is provided regarding a typo (fisrt instead of first) in the parser error recovery logic.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread rusty_lr_parser/src/parser/parser.rs Outdated
@ehwan ehwan merged commit 9045310 into main Jun 21, 2026
1 check passed
@ehwan ehwan deleted the error_token_in_parser branch June 21, 2026 01:07
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.

1 participant