-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
error returned from Capture interface does not contain position and is not wrapped #137
Comments
torbenschinke
changed the title
wrapped error returned from Capture interface does not contain position and is not wrapped
error returned from Capture interface does not contain position and is not wrapped
Apr 8, 2021
Definitely sounds like a bug, thanks! |
If you'd like to send a PR, they're always welcome. |
ok, I'll prepare one |
torbenschinke
added a commit
to torbenschinke/participle
that referenced
this issue
Apr 9, 2021
…contain position and is not wrapped
torbenschinke
added a commit
to torbenschinke/participle
that referenced
this issue
Apr 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes it is useful to return an error from the
Capture(values []string) error
method. However the final returned parser error is not decorated with the position properly.Actually the returned error is a v2.parseError but it does not contain a valid lexer.Position. Also the original error is discarded and just the message is kept instead of using the wrappingParseError type.
It seems like that the decorate function in setField (nodes.go:553) should do the job, but it does not use the tokens position. Also it just uses the parseError type instead of the wrappingParseError.
The text was updated successfully, but these errors were encountered: