coderkalyan / coderkalyan/femtoc
parser: error recovery and hints
- Dominant language
- Zig
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
First draft of error recovery for the AST parser. This involves adding checks for common errors (missing type annotations and punctuation, invalid statements in a certain context) and adding the errors to a global list to be rendered afterwards, rather than cryptically aborting. The parser should also try its best to get back on track and parse the rest of the file. This allows the user to see all syntax errors at once and fix them, and improves future LS analysis/linting. AST errors will still prevent subsequent stages from running.
We should also draft a way to render these errors afterwards with some syntax context.
Once this draft is working, we can apply the same logic to HIR and MIR generation, which also have node (and therefore token) references.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.