Skip to content

Conversation

@steveklabnik
Copy link
Collaborator

Add error recovery to the parser so that when a syntax error is encountered at the item level (function, struct, enum, etc.), the parser can skip tokens until finding the start of the next item and continue parsing.

Key changes:

  • Add Item::Error and Expr::Error variants to AST for recovered error nodes
  • Implement error_recovery() parser using Chumsky's via_parser() strategy
  • Update all Item and Expr match exhaustiveness throughout the codebase
  • Add ErrorContains type to test runner for checking multiple error substrings
  • Add UI tests for multi-error reporting scenarios

Before this change, the compiler would stop at the first parse error. Now it can report multiple errors in a single compilation, helping users fix more issues per compile cycle.

🤖 Generated with Claude Code

Add error recovery to the parser so that when a syntax error is encountered
at the item level (function, struct, enum, etc.), the parser can skip tokens
until finding the start of the next item and continue parsing.

Key changes:
- Add Item::Error and Expr::Error variants to AST for recovered error nodes
- Implement error_recovery() parser using Chumsky's via_parser() strategy
- Update all Item and Expr match exhaustiveness throughout the codebase
- Add ErrorContains type to test runner for checking multiple error substrings
- Add UI tests for multi-error reporting scenarios

Before this change, the compiler would stop at the first parse error.
Now it can report multiple errors in a single compilation, helping users
fix more issues per compile cycle.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@steveklabnik steveklabnik enabled auto-merge January 6, 2026 05:38
@steveklabnik steveklabnik added this pull request to the merge queue Jan 6, 2026
Merged via the queue into rue-language:trunk with commit 6287b53 Jan 6, 2026
4 checks passed
@steveklabnik steveklabnik deleted the steveklabnik/push-swuootxyquww branch January 6, 2026 05:50
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