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

Reporting the position of the last valid token #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aldum
Copy link

@aldum aldum commented Jan 16, 2024

This PR aims to provide the location info of the token facing the one where a parse error occured.
To this end, another line of text is added to the parse error, in the form of

facing: line ?, char ?

The implementation has been tested against a set of cases originally from LuaMinify, with more corner cases added as they come up during manual testing.

The point of adding the previous location is enabling
proper syntax highlighting. For that use, not only the
location of the error is required, but also the point
up to which the code was valid.
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

Successfully merging this pull request may close these issues.

1 participant