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

Parse errors say "column xxx", but the number reported is the position within the file, not within the line #89

Open
richardfearn opened this issue Jan 5, 2024 · 1 comment

Comments

@richardfearn
Copy link

ply only tracks the position of tokens in the whole file (lexpos), but this is used incorrectly as a column number in the errors reported by pyhcl.

See this in the ply documentation:

https://github.com/dabeaz/ply/blob/master/doc/ply.md#line-numbers-and-positional-information

It should be possible to calculate the actual column number using lexpos.

@virtuald
Copy link
Owner

virtuald commented Jan 5, 2024

Seems reasonable, happy to accept a PR with a fix.

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

No branches or pull requests

2 participants