-
Notifications
You must be signed in to change notification settings - Fork 16
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
Possible bug with Any (or Seq)? #3
Comments
I'm getting a similar error. I also don't understand it, but it seems to have something to do with how error handling interacts between nested I'd submit a PR, but I'm not comfortable with applying fixes I don't understand. EDIT: Fixed the link |
superfell
pushed a commit
to superfell/goparsify
that referenced
this issue
Dec 14, 2018
When nested the inner Any() can end up seeing Error.pos set, but Error.expecting to be "". This gets copied into longestError. This can subsequently lead it to not update longestError after calling a child parser (because the child error is before longestError). This results in it incorrectly indicating there was no error.
oec
added a commit
to oec/goparsify
that referenced
this issue
Jun 18, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
First of all - thanks for the great library! I've found a possible bug. I've tried to debug it to find the underlying cause but have struggled a bit. It can be reduced to the following case.
If we have the parser:
I would expect this to be able to parse the string
str
(for the 3rd argument to theAny
) and then try to parse the stringstr
, I get the errorgoparsify.UnparsedInputError{remaining:"str"}
.My exploration of the code is guiding me to think that the
Any
from thestr2
line is not errorring correctly but I can't see how to fix it.Do you agree that the parser defined above should be able to parse
str
? And if so, could you give me a pointer of how I might go about fixing it?Some additional information:
The exact same parser works with the library at commit
0f854720ca2bad30246020bb01cdb903a5f9406d
. I noticed the main thing that has changed in between was the removal of the prediction in theAny
function which my colleague suggested a couple of weeks ago. I can't see anything obvious in that commit which would trigger this new behaviour though.The text was updated successfully, but these errors were encountered: