You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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
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: