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

Attach line number, column number and filename to tokens #2

Open
marcaube opened this issue Apr 6, 2022 · 0 comments
Open

Attach line number, column number and filename to tokens #2

marcaube opened this issue Apr 6, 2022 · 0 comments
Labels
lexer Issue or PR related to lexical analysis

Comments

@marcaube
Copy link
Owner

marcaube commented Apr 6, 2022

To output more useful messages during the parsing stage, it'd be useful to have some meta-data attached to the tokens, such as the line number, column number and filename.

Check https://github.com/rust-analyzer/ungrammar/blob/42810d770e4cddec2a5fff658489fa72f3b28a7c/src/lexer.rs#L17-L27 for inspiration.

@marcaube marcaube added the lexer Issue or PR related to lexical analysis label Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lexer Issue or PR related to lexical analysis
Projects
None yet
Development

No branches or pull requests

1 participant