list of removed parsers: eol, alpha, digit, hex_digit, oct_digit,
alphanumeric, space, multispace
Those parsers were aliases of other parsers, like alpha being an alias
of alias1. So they are still present, this is just reducing the number
of functions to choose from
since we now have specialized versions of a lot of parsers for streaming
or complete input cases, we can remove the awkward types CompleteByteSlice
and CompleteStr, along with uses of the AtEof trait that were present in
most combinators.
This change simplifies the code, and shows (especially in the arithmetic
expressions parser tests) that the new function based solution can
perform the same work as macros while simplifying the code on complete
input
this is a breaking change in their behaviour:
- if they receive an empty input, they will return incomplete (if not at
eof)
- if they reach the end of input without the child parser returning an
error, they will return Incomplete
while this may break some parsers, this behaviour is more logical with
the rest of nom and much stricter
if we reached the end of input, test with at_eof, to see if we should
return the whole input slice or not.
This will potentially break some existing parsers that rely on many0
trying to consume everything, but this behaviour is more correct and
aligned with the rest of nom
this will make it easier to be compatible with other crates like
error_chain, and we can reuse a lot of code coming for free with
Result. Incomplete is merged into the error side. I still do not
consider it to be an error,but this side will also contain unrecoverable
errors at some point (errors that cause alt and others to return
instead of testing the next branch), so it will be easier to put it in
this enum.
These can be run on Rust Nightly using:
cargo bench --features nightly --test ini
and
cargo bench --features nightly --test ini_str
On my machine, these currently run at around 99 MB/s and 101 MB/s
respectively (best of many runs).