m4rw3r / chomp

A fast monadic-style parser combinator designed to work on stable Rust.
Apache License 2.0
243 stars 19 forks source link

`or` fails with incomplete even though second parser could have succeeded on the input #35

Closed m4rw3r closed 8 years ago

m4rw3r commented 8 years ago

combinators::or fails with Incomplete if the first parser reports incomplete, even if the second parser would have succeeded. This is not an issue when the input is not yet finite, since the first parser could be expecting a large piece of data and in that case asking for more input and then retrying is the correct action. But when the input is finite and parsing failed with incomplete on the first parser, the second parser should be attempted before giving up.

This will be a backwards incompatible change.