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

Lexer syntax errors point to the wrong span #445

Open
mitsuhiko opened this issue Mar 23, 2024 · 0 comments
Open

Lexer syntax errors point to the wrong span #445

mitsuhiko opened this issue Mar 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mitsuhiko
Copy link
Owner

Description

When working on #443 I noticed that syntax errors in the lexer point to wrong span

Reproduction steps

Try to parse the following template:

{{ 10_ }}

Additional helpful information:

  • Version of minijinja: 1.0.15

What did you expect

syntax error: '_' may not occur at end of number (in err_bad_trailing_underscore.txt:1)
----------------------- err_bad_trailing_underscore.txt -----------------------
   1 > {{ 10_ }}
     i      ^ syntax error

Instead I got

syntax error: '_' may not occur at end of number (in err_bad_trailing_underscore.txt:1)
----------------------- err_bad_trailing_underscore.txt -----------------------
   1 > {{ 10_ }}
     i ^^ syntax error
@mitsuhiko mitsuhiko added the bug Something isn't working label Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant