Skip to content

Add error recovery for AST analysis#217

Open
gerau wants to merge 2 commits intoBlockstreamResearch:masterfrom
distributed-lab:simc/analyzer-multiple-errors
Open

Add error recovery for AST analysis#217
gerau wants to merge 2 commits intoBlockstreamResearch:masterfrom
distributed-lab:simc/analyzer-multiple-errors

Conversation

@gerau
Copy link
Contributor

@gerau gerau commented Feb 11, 2026

No description provided.

@gerau gerau force-pushed the simc/analyzer-multiple-errors branch 2 times, most recently from b95d57c to fcf910f Compare February 16, 2026 12:47
@gerau gerau changed the title Simc/analyzer multiple errors Add error recovery for AST analysis Feb 16, 2026
@gerau gerau marked this pull request as ready for review February 16, 2026 13:40
@gerau gerau requested a review from delta1 as a code owner February 16, 2026 13:41
This adds error states for `parse::Expression`, `ast::Expression`
`ResolvedType` and `AliasedType`.

Error recovery introduced by `chumsky` parser
require some default states to recover to, which was represented before
with
dummy values, like unit type for expression or alias with `error` name.
However, this kind of recovery is not desirable in case of further
analyzing of parse tree, because it would lead to unrecognazible errors
on analyzer.
@gerau gerau force-pushed the simc/analyzer-multiple-errors branch from fcf910f to 2f99ae4 Compare February 18, 2026 09:54
Add error reporting and remade `Program::analyze` function, so it would
return `Option` like it is done right now with parsing.

All errors should be return from `Result` or be reported to the scope.
@gerau gerau force-pushed the simc/analyzer-multiple-errors branch from 2f99ae4 to 66b913e Compare February 18, 2026 11:42
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

Comments