minimal-lexical is a smaller library (compile faster), has no
dependencies, and is faster than lexical-core 0.7 (0.8 will have the
same algorithm).
It requires a separate tokenization phase, done manually, but this will
give more flexibility in supporting different syntaxes
This commit removes the "lexical" feature, as there is no need now
tosupport a separate version without the crate
these parsers convert directly to numbers from text decimal
representation. If the parsed number gets to large for the target type,
the parser will fail
this commit also introduces testing through proptest, to make sure that
those parsers are functionally equivalent to digit1 then calling
.parse() on it
the call to find() returns an index in the slice that is already at a
char boundary, so the check done by split_at is not needed. The
get_unhecked call is needed instead of self.get() to prevent the
reintroduction of bound checks
When commit 981d036ca8 changed the basic
error type, it left no way for the user to take ownership of the
values of this new type.
Fixes#1254.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
many*, fold_many* and other related combinators have an infinite loop
check that makes sure the child parser is always consuming data
(otherwise it could be reapplied without ever stopping).
That check was done by testing if the remaining input was equal, which
consists of a length test, then checking equality of all the elements.
This commit replaces the equality check with just a length check (error
if remaining has same length as input), which should amoount to the same
work as PartialEq in the common case, but will generate less code
if the "normal" parser in escaped does not consume anything, the escaped
and escaped_transform combinators would go in an infinite loop trying to
apply it, then looking for a control char that is not there, then going
back to the normal parser
the combinators in the form "<function name>c" were used to fix type
inference issues in macro combinators that call the main function
combinators.
They are not used anymore and were not part of the public API