-
Notifications
You must be signed in to change notification settings - Fork 22
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
err without context of L #6
Comments
Sorry for seeing this so late, I think that's a good point. I suppose the solution will be to add that information to the error being thrown so that it can show this information in its message. I'd be happy to merge a PR with these changes. |
tvanriel
added a commit
to tvanriel/go-lexer
that referenced
this issue
Jun 4, 2022
Errors generated by l.Error() will now be wrapped with "lexer(pos=line,pos): " to improve the developer experience. Fix: bbuck#6 Signed-off-by: Ted van Riel <[email protected]>
@longxueyuu @bbuck If you're interested in my solution I can make a merge request :-) |
Sure let me take a look this weekend. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when the lexer starts to analyze the source string, if err occurs, L does not provider any interface to expose 'start', 'position' info of source string to bind to the error;
the error is printed without this context info, so it is kind of difficult to locate the error in source string.
The text was updated successfully, but these errors were encountered: