Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Fix inconsistent diagnostics (needs tests)
Diagnostic positions were reported inconsistently based on newlines after the error line. This was caused by updating the parser's previous character every time the parser moved to a new line, rather than leaving the previous character on the last parsed token. Because asfv1 doesn't raise errors until it hits a non-whitespace token, this meant that the previous character would be moved from the token that caused the error to the whitespace that followed it. Now, the previous character is only updated once at the beginning of __next__, meaning that it stays on the last successfully parsed token.
- Loading branch information