Skip to content

Commit

Permalink
test the combinator table as documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Feb 11, 2018
1 parent 4048496 commit 00b25f4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/choosing_a_combinator.md
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)|

0 comments on commit 00b25f4

Please sign in to comment.