Commit Graph

55 Commits

Author SHA1 Message Date
Geoffroy Couprie
9cff115667
Ensure all examples compile (#1604)
* docs: Remove unused example

* docs: Ensure all examples compile

Co-authored-by: Ed Page <eopage@gmail.com>
2022-12-30 16:29:22 +01:00
wuaoxiang
4a2f9af9ed Add JsonValue::Null to json example 2021-10-23 22:34:38 +02:00
wuaoxiang
337c218965 Fix typos 2021-10-23 22:34:38 +02:00
Antoine PLASKOWSKI
d15a2669a8 Remove jemalloc for test 2021-10-23 09:41:41 +02:00
Constantin Nickel
6ecee46e4c Re-enable the iterator example
Apply the current code formatting
2021-09-25 16:21:31 +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
jufajardini
ab01f04375 Update json.rs
Hey, I'm trying to get a better understanding of `nom` reading this example, and think the following makes sense:
- delete lines `70` and `71`, as `value` was already described (lines `64 to 66`), and this other description seemed incomplete
- change `true` to `false` in line `75`, as it makes more sense with the code that follows
2021-01-23 17:15:04 +01:00
Geoffroy Couprie
b52d460276 fmt 2020-10-24 15:19:14 +02:00
Geoffroy Couprie
af7d8feda4 Introduce the FromExternalError trait for map_res and verify
*breaking change*

this trait allows a custom error type to integrate errors from functions
like `FromStr::from_str`.
This is a breaking change because it modifies the API of `map_res` to
require this trait
2020-08-30 11:02:17 +02:00
Bastien Orivel
74bdbed6f9 Fix a few typos in the documentation 2020-05-30 12:06:40 +02:00
Antoine Cezar
e766634631
Add custom errors example (#1151)
* Add example of custom error

* Add custom_errors.rs link to documentation
2020-05-30 11:55:38 +02:00
Geoffroy Couprie
afad7bf93e formatting 2020-04-10 11:08:18 +02:00
Geoffroy Couprie
e6ebcd7193 rename separated_list to separated_list0
and separated_nonempty_list to separated_list1
2020-04-09 17:27:05 +02:00
Geoffroy Couprie
84d1ac025b move parser implementation to use a Parser trait
this parser trait reproduces the behaviour of previous nom functions,
and uses &mut self instead of &self to allow FnMut closures to be used
as parsers
2020-04-09 16:10:26 +02:00
Geoffroy Couprie
3ef05ba397 remove the add_context method from ParseError
it is used only in the `context` combinator, so there is o need to
require it everywhere else
2020-04-08 11:44:32 +02:00
Nathan West
dba7d449c8 Added comment to string parser 2020-02-24 11:55:21 +01:00
Nathan West
6c15061f61 Fixed broken build on rust 1.31; extra comments 2020-02-24 11:55:21 +01:00
Nathan West
ffb4c6493c Added example for an escaped string parser 2020-02-24 11:55:21 +01:00
Geoffroy Couprie
ca1053a166 fix json example compilation 2020-01-07 18:37:29 +01:00
Geoffroy Couprie
c6d03c54b3
Merge branch 'master' into patch-1 2020-01-07 18:28:07 +01:00
Adam Nemecek
a2cb448f53 trimmed whitespace 2020-01-07 18:23:12 +01:00
Sven Lechner
719e3f923f fix intent 2020-01-07 18:10:07 +01:00
Nathan West
f9565fba97 Added more detailed comments to json 2019-12-21 11:37:13 -05:00
Nathan West
cf1d27cb29 Fixed aliasing issue; rustfmt 2019-12-21 10:37:07 -05:00
Nathan West
bd5e30817d
Simplify boolean in json.rs example 2019-12-21 00:55:04 -05:00
Bruce Mitchener
da2ba9a70c Fix typos. 2019-06-28 13:27:50 +02:00
Mark McCaskey
04259287e7 clean up example, add tutorial comments 2019-06-16 11:57:25 +02:00
Mark McCaskey
7e3030adc7 Add S-expression parsing example 2019-06-16 11:57:25 +02:00
Geoffroy Couprie
2a999a8094 add more comments on the iterator example 2019-05-29 16:12:08 +02:00
Geoffroy Couprie
5405e1173f add comments to the JSON example 2019-05-29 11:12:15 +02:00
Geoffroy Couprie
3e6c8f159b example for the iterator combinator 2019-05-28 11:01:30 +02:00
Geoffroy Couprie
9f5b32b50f fix column position 2019-05-23 11:32:15 +02:00
Geoffroy Couprie
0d4f6bb23e apply the context combinator at the right index 2019-05-23 11:31:55 +02:00
Geoffroy Couprie
2cfa50008c proper end of file parsing 2019-05-23 10:56:37 +02:00
Geoffroy Couprie
51545eb4b0 use the cut combinator in JSON 2019-05-23 10:54:10 +02:00
Geoffroy Couprie
a976ed03fe rewrite the JSON example 2019-05-22 16:52:05 +02:00
Geoffroy Couprie
f19d2d8084 add iterator example 2019-05-06 16:45:30 +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
c20d362cdd expose the branch and multi modules 2019-04-16 15:53:07 +02:00
Geoffroy Couprie
1eb5426605 remove warnings 2019-04-16 15:42:28 +02:00
Geoffroy Couprie
6e2290d4bc expose the sequence module 2019-04-16 11:24:46 +02:00
Geoffroy Couprie
8c55f4cb45 specialize the bytes module for streaming/complete
remove some uses of need_more
2019-04-15 16:47:16 +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
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
dfb9dc36c6 start making streaming or complete input specific versions of some parsers 2019-04-13 18:21:51 +02:00