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

Fixed incorrect lexer position reports #630

Merged
merged 5 commits into from
Nov 3, 2024
Merged

Fixed incorrect lexer position reports #630

merged 5 commits into from
Nov 3, 2024

Conversation

mitsuhiko
Copy link
Owner

@mitsuhiko mitsuhiko commented Nov 3, 2024

This fixes the logic in the lexer and parser so that on lexing errors the right information. The way this is correctly implemented is by making the lexer aware of the filename so that it can already report errors correctly. The error attachment logic in the parser is also slightly changed now.

It's a bit unfortunate that this breaks the unstable machinery API but I'm not sure if there is a particularly nice way to avoid that. At least this makes it slightly less weird. Now at least the lexer and parser are at least in the position of reporting the correct error locations on their own.

Fixes #445

@mitsuhiko mitsuhiko merged commit afeba23 into main Nov 3, 2024
33 checks passed
@mitsuhiko mitsuhiko deleted the fix-lexer-errors branch November 3, 2024 14:47
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.

Lexer syntax errors point to the wrong span
1 participant