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

Add line and column numbers to error messages #128

Merged
merged 6 commits into from
Aug 23, 2021

Conversation

MysteryBlokHed
Copy link
Owner

@MysteryBlokHed MysteryBlokHed commented Aug 23, 2021

Closes #127

  • Add line and column numbers to error messages
    • Messages from tokenize.rs
    • Messages from preprocess.rs
  • Add filenames to error messages

Adds line and column numbers to error messages from tokenize.rs via a
new function make_syntax_error.
@github-actions github-actions bot added the source Affects the project's source label Aug 23, 2021
Adds the canonical filepath as well as the line/column numbers to the
error message (eg. `/path/to/file:5:10`).
Changes the error message for a misplaced tag to a panic, since tokens
outside functions should be ignored.
Adds line and column numbers to the macro error from preprocess.rs. This
was done by adding two usizes to the MacroName token. This might not be
the most efficient way to do it, but it was the fastest.
Fixes the column number being 1 higher than it should be due to the
newline character incrementing the column integer.
@MysteryBlokHed MysteryBlokHed marked this pull request as ready for review August 23, 2021 16:51
@MysteryBlokHed MysteryBlokHed merged commit 30df51b into master Aug 23, 2021
@MysteryBlokHed MysteryBlokHed deleted the 127-better-error-messages branch August 23, 2021 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source Affects the project's source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Suggestion] More helpful error messages
1 participant