pyhcl
pyhcl copied to clipboard
Parse errors say "column xxx", but the number reported is the position within the file, not within the line
trafficstars
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.
Seems reasonable, happy to accept a PR with a fix.