Commit Graph

296 Commits

Author SHA1 Message Date
Geoffroy Couprie
107abd537c remove some redundant combinators
most of those were present at the beginning of nom but can be
implemented by combining other more general parsers
2019-04-27 19:30:31 +02:00
Geoffroy Couprie
f10ed50ba8 remove count_fixed
this combinator was barely used, and it was the only use of unsafe in nom
2019-04-26 19:21:57 +02:00
Geoffroy Couprie
4087c71afc fix unit tests 2019-04-26 16:22:16 +02:00
Geoffroy Couprie
ab7211e2fc remove some character parsers
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
2019-04-26 16:12:36 +02:00
Geoffroy Couprie
3fffcd61fc fix imports 2019-04-21 18:27:28 +02:00
Geoffroy Couprie
3d929e68ba fix imports 2019-04-20 19:15:43 +02:00
Geoffroy Couprie
ee5aeb0d0b merge the macros.rs and nom.rs modules in the combinator module 2019-04-20 12:16:38 +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
14665d61ee implement opt, map and map_res as functions 2019-04-17 11:01:14 +02:00
Geoffroy Couprie
7d22ddef36 fix some tests 2019-04-15 16:53:57 +02:00
Geoffroy Couprie
d396d3b9f9 fix compilation 2019-04-15 15:22:38 +02:00
Geoffroy Couprie
4b31ffee2f make speciaized versiuons of most character level parsers 2019-04-15 15:15:14 +02:00
Geoffroy Couprie
fc4532fc37 make specialized versions of jumber parsers for streaming and complete 2019-04-15 11:43:03 +02:00
Geoffroy Couprie
f5bdaab2d5 move ErrorKind to the error module 2019-04-15 11:07:48 +02:00
Geoffroy Couprie
b306b847b0 rename simple_errors to error module
remove some dead code
2019-04-15 10:33:07 +02:00
Geoffroy Couprie
9e2bd27f2d move the character level parsers from the nom module to character 2019-04-15 10:05:49 +02:00
Geoffroy Couprie
64eb6bdc70 move number parsers to the number module 2019-04-13 19:17:37 +02:00
Geoffroy Couprie
6e0caba39c remove uses of FnMut 2019-04-13 16:07:30 +02:00
Geoffroy Couprie
cf2f6d8d35 fix lifetime inference errors 2019-04-10 16:44:17 +02:00
Geoffroy Couprie
b62a005c6e fix unit tests 2019-04-09 09:23:34 +02:00
Geoffroy Couprie
bdab54a15b fix warnings 2019-04-03 12:00:13 +02:00
Geoffroy Couprie
9a550ffdfb start integrating the new error management 2019-04-02 19:58:40 +02:00
Geoffroy Couprie
7e9c93cee2 remove some tag_s uses 2019-03-23 14:18:55 +01:00
Geoffroy Couprie
4257253914 remove deprecated string parsers 2019-03-23 12:57:05 +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
Josh Mcguigan
0ee517f37e Added array test 2018-12-14 15:54:17 +01:00
Josh Mcguigan
660f49e86c Improved json test 2018-12-14 15:54:17 +01:00
Geoffroy Couprie
49a20d4f2b update changelog and bump version to 4.1.1 2018-10-14 16:10:21 +02:00
Geoffroy Couprie
19c4967ebb remove unused compilation tag 2018-10-06 15:38:07 +02:00
Geoffroy Couprie
277caa10a4 fix unused doc comment 2018-10-06 15:08:36 +02:00
Sven Marnach
2b21686bb3 Simplify is_hex_digit() in example. 2018-10-06 15:06:02 +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
Konrad Borowski
285d21cf43 Use match instead of comparisons in is_hex_digit example in README
This makes it more readable for programmers who don't remember the ASCII table.
2018-05-19 11:57:41 +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
Konrad Borowski
8be1b06d7f Allow using take_till1! macro without having ErrorKind imported
Fixes #759
2018-05-19 11:41:18 +02:00
Geoffroy Couprie
a2a66c84fe remove unused tests 2018-05-14 13:46:31 +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
dbbd6c9c3b remove unused test 2018-02-25 12:22:53 +01:00