-
Notifications
You must be signed in to change notification settings - Fork 52
Array combinators don't propagate fail "with consumption" #234
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
Comments
Thank you for the report and for the reproduction. That does look like a bug. |
I will try to fix this but may not get to it in the next few days. If someone else wants to attempt a PR for this, I would recommend to make a PR with 2 commits:
|
Parsing.Combinators.Array.many: Parsing.Combinators.many: |
To be clear, the issue here is that we shouldn't be using |
Yes. |
Describe the bug
Parsing is designed to distinguish between fail with and without data consumed. In particular, the combinators from
Parsing.Combinators
as well as ones fromData.Array
propagate fail if it happens after data was consumed.Unfortunately, this isn't the case for at least
many*
combinators fromParsing.Combinators.Array
To Reproduce
Execute the following code:
Expected behavior
All 4 parses would return
Left
Actual behavior
The
Array
-based parses return successfully:Workarounds
many
fromData.Array
works as expected. However, there isn't analogous function formany1
.The text was updated successfully, but these errors were encountered: