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

Line directives for the lexer #172

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Line directives for the lexer #172

merged 1 commit into from
Jan 21, 2025

Conversation

ppolesiuk
Copy link
Member

This PR introduces line directives recognized by the lexer. For instance, in

#@ 123 foo.fram
let x = ... some error ...

the error will be reported in foo.fram at line 123.

Moreover, the lexer warns when it encounters other comments starting with #@. We might use such comments for other directives in the future.

Resolves #128

@Brychlikov
Copy link
Contributor

My only worry is the legibility of error messages. Currently, if there is an error with line directive pointing to a nonexistent file or a nonexistent line in an existing file, we just quietly don't show any context. I think there should at least be a warning in this case.
I don't have much experience working with code generators, so other than that, I think it's fine.

adampsz

This comment was marked as resolved.

@ppolesiuk ppolesiuk merged commit 9a2c623 into master Jan 21, 2025
2 checks passed
@ppolesiuk ppolesiuk deleted the 128-line-directives branch January 21, 2025 13:34
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.

Line directives for the lexer
3 participants