-
Notifications
You must be signed in to change notification settings - Fork 1
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
Failing non-chomping andThenOneOf
parser fails the already parsed oneOf
value
#1
Comments
Thank you for your bug report. 1.First, this is not what happens here. If a failing If you print the exact character of you error, you can see that it fails on
You are confronted to the unfortunate following elm/parser The To confirm, use In your case, after the You have several solutions here:
or https://ellie-app.com/5f34QnwQtSKa1
I'm not sure which one has the best performance, you will have to benchmark. Also I would advice to take the time to read and become familiar with all the bug reports of 2.Secondly, I don't want any part of the library to use 3.Lastly, every For example if you really wanted to add https://ellie-app.com/5f8RtZHvr2ma1
But as explained in 1., this is not needed here anyway. Another example, you could redefine your left-associative operator-less https://ellie-app.com/5f925BH6LVva1
and
or
But again, this is not really needed here, because your I will try to improve the documentation in the next release to better explain some of these points. |
Thanks! Yes, I was seeing it fails on a weird spot (inside the "else" and not near the number) but didn't connect the dots wrt. 'e'. Will look over the elm/parser bugs. Also, I agree with your assessment of the situation wrt. backtrackable. 👍 |
SSCCE: https://ellie-app.com/5dYn9vN2ggra1
If we have already parsed an
oneOf
value, and for some reason theandThenOneOf
parsers fail, we should succeed on the parsed value, not fail the whole thing.This only shows up when an
andThenOneOf
parser is non-chomping (ie.Parser.succeed ()
orParser.spaces
or something similar).I have found that adding
backtrackable
toinfixHelp
helps:I'm not sure which one of these is correct though.
EDIT: It might be worth looking at
postfix
too?The text was updated successfully, but these errors were encountered: