forked from rust-bakery/nom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test the combinator table as documentation
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# List of parsers and combinators | ||
|
||
## Basic elements | ||
Those are used to recognize the lowest level elements of your grammar, like, "here is a dot", or "here is an big endian integer". | ||
|
||
| usage | input | output | comment | | ||
|--|--|--|--| | ||
| `char!('a')` | `"abc"` | `Ok(("bc", 'a'))`| matches one character (works with non ASCII chars too) | | ||
| ` is_a!("ab")` | `"ababc"` | `Ok(("c", "abab"))`|matches a sequence of any of the characters passed as arguments. `is_a_s` is an alias for `is_a`| | ||
| `is_not!("cd")` | `"ababc"` | `Ok(("c", "abab"))`|matches a sequence of none of the characters passed as arguments| | ||
| `one_of!("abc")` | ``"abc"`` | `Ok(("bc", 'a'))`|matches one of the provided characters (works with non ASCII characters too)| | ||
|