Commit Graph

73 Commits

Author SHA1 Message Date
Michael Bryant
ee7ad17086 avoid panic when counting zero-sized outputs in count() (#1618)
* avoid panic when counting zero-sized outputs in count()

* run cargo fmt
2023-01-15 21:59:46 +01:00
John Kugelman
3645656644 Clamp Vec::with_capacity to 64KiB to avoid OOM 2022-09-12 21:36:46 +02:00
Geoffroy Couprie
8285735f93 as_slice is not available on array in 1.48 2022-03-14 23:30:39 +01:00
Fredrick Brennan
bb8ef79733 impl<'a> FindToken<char> for &'a [char]
Close Geal/nom#1282.
2022-03-14 22:54:19 +01:00
Guillaume
b4d50017e2 Use [] for vec! macro 2021-10-21 23:16:49 +02:00
Geoffroy Couprie
d3323ae948 fmt 2021-08-05 18:33:49 +02:00
Constantin Nickel
02ff562092 remove macros from issue tests 2021-08-05 16:18:39 +02:00
Constantin Nickel
f54616848f remove macro related tests for previous issues
The type-inference tests for macros are no longer needed.
2021-08-05 16:18:39 +02:00
Geoffroy Couprie
bd1adeb8ce fmt 2020-11-24 11:29:17 +01:00
Pierre Chifflier
76c52af52f Fix bits and bytes functions, expecting Fn instead of FnMut (Closes #1231) 2020-11-24 10:28:23 +01:00
Geoffroy Couprie
6168f7b7e1 use fold_many0c in the fold_many0 macro 2020-10-25 16:52:40 +01:00
Geoffroy Couprie
b52d460276 fmt 2020-10-24 15:19:14 +02:00
Geoffroy Couprie
8a4efe51e3 the regexp_macros is not used anymore
fix the issues related unit tests that were not compiled anymore
2020-10-11 16:12:42 +02:00
Geoffroy Couprie
afad7bf93e formatting 2020-04-10 11:08:18 +02:00
Geoffroy Couprie
517bc7759c fix panic in convert_error 2020-01-07 19:11:19 +01:00
Aleksander Heintz
6d235a705c
Move test and revert old test 2019-09-13 22:46:29 +02:00
Mathieu Poumeyrol
8829a2a38c fix many_m_n for n=0 2019-07-28 10:42:58 +02:00
Geoffroy Couprie
5ce22d8d4c fix unit tests 2019-06-17 16:12:06 +02:00
Geoffroy Couprie
fa743698f7 fix failing test 2019-05-08 19:28:13 +02:00
YOSHIOKA Takuma
01d079e3e9 Stop converting Err::Error to Err::Failure in error::context()
Closes #942.
2019-05-08 10:11:28 +02:00
Geoffroy Couprie
a1390dd56c missing length_bytes 2019-05-06 15:48:56 +02:00
Geoffroy Couprie
4087c71afc fix unit tests 2019-04-26 16:22:16 +02:00
Geoffroy Couprie
d85878e26a remove usage of CompleteByteSlice and CompleteStr
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
2019-04-17 12:14:15 +02:00
Geoffroy Couprie
7d22ddef36 fix some tests 2019-04-15 16:53:57 +02:00
Geoffroy Couprie
b62a005c6e fix unit tests 2019-04-09 09:23:34 +02:00
Geoffroy Couprie
7e9c93cee2 remove some tag_s uses 2019-03-23 14:18:55 +01:00
Geoffroy Couprie
ed915073c8
Merge branch 'master' into issue-768-bitvec-parser 2019-03-04 10:38:03 +01:00
Geoffroy Couprie
f8019ecddd do not require a regex crate import, use the one in dependencies instead 2018-12-28 11:23:39 +01:00
Geoffroy Couprie
7f0e9ec68c fix overflow in the byte wrapper for bit level parsers 2018-12-26 19:22:18 +01:00
Geoffroy Couprie
49a20d4f2b update changelog and bump version to 4.1.1 2018-10-14 16:10:21 +02:00
Geoffroy Couprie
0009b6090a add tests from issues 2018-08-18 18:05:09 +02:00
François Laignel
cd1275054f Use a dedicate error kind for parse_to!
Upon failure, `parse_to!` returns an error with `ErrorKind::MapOpt`.
Return `ErrorKind::ParseTo` instead.

Reproduce with:
``` rust
use nom::{Context, Err, ErrorKind};

assert_eq!(
    Err::Error(Context::Code("ab", ErrorKind::MapOpt)),
    parse_to!("ab", usize).unwrap_err(),
)
```
2018-08-18 16:27:48 +02:00
Szabolcs Berecz
4e74e735c3 Fixes #780: "Use of undeclared type or module Needed" 2018-07-15 21:45:07 +02:00
Szabolcs Berecz
c6ff19802d Fixes #768: Generalize bits.rs to handle inputs other than &[u8] 2018-05-25 19:12:55 +02:00
Geoffroy Couprie
ed1abaf03c fix type inference in the value combinator 2018-05-19 11:53:08 +02:00
Geoffroy Couprie
a7aa0c6cd5 move the test for issue 759 to the tests/issues.rs file 2018-05-19 11:53:08 +02:00
Sharad Chand
1de2b6ff56 Demonstrate issue #741 2018-04-25 11:47:10 +02:00
Kamil Markiewicz
9d16b67790 Some tests are constrained just on alloc 2018-04-08 12:00:44 +02:00
Geoffroy Couprie
fb119849da fix unit tests 2018-03-28 10:56:16 +02:00
Geoffroy Couprie
77405b915a do not require PartialEq on results in permutation 2018-03-26 11:21:59 +02:00
Geoffroy Couprie
fd490f6c60 implement FindToken for arrays 2018-03-26 11:09:58 +02:00
Sebastian Zivota
662c872729 Fixed issue #721 2018-03-26 10:49:21 +02:00
Geoffroy Couprie
87eabf9049 always install rusfmt
run rustfmt on stable
2018-02-25 13:30:13 +01:00
Geoffroy Couprie
43ed4e99f3 Merge branch 'alloc-feature' of https://github.com/kamarkiewicz/nom into kamarkiewicz-alloc-feature 2018-02-17 16:07:16 +01:00
Geoffroy Couprie
55bac0bfa8 fmt 2018-02-17 15:06:43 +01:00
Kamil Markiewicz
791a53cf62
WIP tests behind alloc 2018-02-05 23:18:40 +01:00
Geoffroy Couprie
d6f35cc341 fix unit tests in no_std and verbose-errors 2018-01-24 17:40:52 +01:00
Geoffroy Couprie
62a0e75a70 add a test for issue 667 2018-01-24 17:16:07 +01:00
Geoffroy Couprie
526299c2a6 support dbg_dmp for CompleteByteSlice 2018-01-24 16:36:34 +01:00
Geoffroy Couprie
7bc5d426df Fix byte indexing in not_line_ending 2018-01-15 12:07:51 +01:00