Commit Graph

2625 Commits

Author SHA1 Message Date
Geoffroy Couprie
e2a0dd52e0 v7.0.0-alpha3 2021-08-18 19:04:14 +02:00
Geoffroy Couprie
e6f17e2cba fmt 2021-08-18 18:59:35 +02:00
Geoffroy Couprie
b57026bd03 fix streaming usage 2021-08-18 18:57:18 +02:00
Geoffroy Couprie
272de11b1c fix performance regressions 2021-08-18 17:23:43 +02:00
Geoffroy Couprie
704cfed72a current proptests for floats require the std feature 2021-08-18 17:16:32 +02:00
Geoffroy Couprie
baf5e015b9 replace lexical-core with minimal-lexical
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
2021-08-18 00:05:47 +02:00
Geoffroy Couprie
6cd562ebd3 fix property tests 2021-08-17 17:34:21 +02:00
Geoffroy Couprie
485147144c fix a stack overflow in the expression parser 2021-08-17 16:46:34 +02:00
Geoffroy Couprie
8b453bd024 fix fuzzing target compilation 2021-08-17 16:43:46 +02:00
Geoffroy Couprie
45d11216db proptest should be a dev dependency 2021-08-17 16:43:24 +02:00
Geoffroy Couprie
018cd45966 add text to number parsers
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
2021-08-17 16:37:38 +02:00
cenodis
808a85bbcf Add fail parser 2021-08-17 11:42:00 +02:00
cenodis
a91dd52477 Document second argument of multi::length_value 2021-08-17 11:40:29 +02:00
Geoffroy Couprie
ea483e5a81 fix formatting 2021-08-14 15:47:43 +02:00
Geoffroy Couprie
5777c81cdd update the error management doc 2021-08-14 15:43:42 +02:00
Geoffroy Couprie
ef5e0bbc9b raise MSRV to 1.46
bitflags in lexical will not compile below 1.46
2021-08-13 14:47:03 +02:00
Geoffroy Couprie
4f046c61b4 unused code 2021-08-13 14:35:50 +02:00
Geoffroy Couprie
834a2caf8c clarify combinator argument names 2021-08-13 14:35:12 +02:00
Geoffroy Couprie
43c62fd0be compile on 1.41.1 without lexical
lexical is now integrating a version of bitflags that is incompatible
with Rust 1.41.1
2021-08-13 12:57:17 +02:00
Geoffroy Couprie
9ddbc00c1f move HexDisplay to the traits module
remove the util module
2021-08-13 12:52:16 +02:00
Geoffroy Couprie
5637d0b37f reintroduce dbg_dmp, move it to the error module 2021-08-13 12:49:33 +02:00
Geoffroy Couprie
caa9d4e628 fix the bitflags version for lexical-core
bitflags 1.3 (released yesterday) introduces some const fn usage
incompatible with Rust 1.41.1
2021-08-13 11:46:07 +02:00
Constantin Nickel
9057c7e773 fix broken intra doc link warnings 2021-08-13 11:03:55 +02:00
Constantin Nickel
ebab6ca7f0 ci: build docs with docsrs feature 2021-08-13 11:03:55 +02:00
Geoffroy Couprie
37eedf3e8b check for min > max in fold_many_m_n too 2021-08-13 10:55:00 +02:00
Geoffroy Couprie
4a04c56507 the check for min > max in many_m_n should return a Err::Failure 2021-08-13 10:54:14 +02:00
Geoffroy Couprie
55ab2644d2 avoid a check to is_char_boundary in split_at_position* for &str
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
2021-08-13 10:49:48 +02:00
Geoffroy Couprie
cea9829bf9 simplify split_at_position* for &[u8] 2021-08-13 10:42:12 +02:00
Geoffroy Couprie
04ed375574 use take_split instead of manual slices 2021-08-09 19:45:49 +02:00
Anders Kaseorg
39441748cc Add to_owned for Err<Error<&[u8]>>, Err<Error<&str>>
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>
2021-08-09 19:04:24 +02:00
Geoffroy Couprie
173ce1c734 use a length check instead of PartialEq in infinite loop checks
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
2021-08-09 18:43:11 +02:00
Geoffroy Couprie
ab42cedb9c many_m_n should fail if min > max 2021-08-09 18:20:46 +02:00
Geoffroy Couprie
d31a752a59 fix infinite loop in escaped
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
2021-08-09 18:13:42 +02:00
Geoffroy Couprie
eec971a60d fix benchmark compilation 2021-08-09 17:39:46 +02:00
cenodis
18cc1d18b9 Remove Clone trait bound from fold parsers
Update documentation
2021-08-09 17:35:40 +02:00
Constantin Nickel
5a65658a95 fix edition idioms 2021-08-09 17:30:00 +02:00
Constantin Nickel
f5de114da2 organize imports by feature 2021-08-09 17:29:15 +02:00
Geoffroy Couprie
386c7111b7 implement missing take_until1 combinator 2021-08-08 16:51:06 +02:00
Geoffroy Couprie
0abf07b10b v7.0.0-alpha2 2021-08-06 14:09:35 +02:00
Geoffroy Couprie
214f623a9f do not run the tests on MSRV
criterion 0.3.5 does not build on Rust 1.41.1 and dev-dependencies
cannot be made optional
2021-08-05 18:54:17 +02:00
Geoffroy Couprie
de69f69c55 rustdoc::missing_doc_code_examples is not recognized on Rust 1.41.1 2021-08-05 18:42:18 +02:00
Guillaume
0ddf113f68 🎨 🚨 cargo ftm and deprecated missing_doc_code_examples 2021-08-05 18:34:21 +02:00
Geoffroy Couprie
d3323ae948 fmt 2021-08-05 18:33:49 +02:00
Geoffroy Couprie
a2b683b119 remove ErrorKind::ParseTo 2021-08-05 18:30:44 +02:00
Geoffroy Couprie
25d3148aff cleanup
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
2021-08-05 18:27:17 +02:00
Constantin Nickel
59bf911ad8 remove macros from bytes module 2021-08-05 18:09:39 +02:00
Geoffroy Couprie
f49ba8e9d4 remove macros from combinator, error and util modules 2021-08-05 18:06:53 +02:00
Geoffroy Couprie
977f93fed4 remove macros from character module 2021-08-05 17:25:47 +02:00
Geoffroy Couprie
55279a2a31 remove macros from bits module 2021-08-05 17:12:22 +02:00
Geoffroy Couprie
14f0872232 remove macros from sequence module 2021-08-05 17:10:38 +02:00