Skip to content

Commit

Permalink
Fix missing tuple in code example (#1728)
Browse files Browse the repository at this point in the history
* Fix missing tuple in code example

* Update doc/choosing_a_combinator.md

---------

Co-authored-by: Geoffroy Couprie <[email protected]>
  • Loading branch information
JonathanPlasse and Geal authored Apr 21, 2024
1 parent 147f8f0 commit a209ff1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/choosing_a_combinator.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Those are used to recognize the lowest level elements of your grammar, like, "he
| [terminated](https://docs.rs/nom/latest/nom/sequence/fn.terminated.html) | `terminated(tag("ab"), tag("XY"))` | `"abXYZ"` | `Ok(("Z", "ab"))` ||
| [pair](https://docs.rs/nom/latest/nom/sequence/fn.pair.html) | `pair(tag("ab"), tag("XY"))` | `"abXYZ"` | `Ok(("Z", ("ab", "XY")))` ||
| [separated_pair](https://docs.rs/nom/latest/nom/sequence/fn.separated_pair.html) | `separated_pair(tag("hello"), char(','), tag("world"))` | `"hello,world!"` | `Ok(("!", ("hello", "world")))` ||
| [tuple](https://docs.rs/nom/latest/nom/sequence/fn.tuple.html) | `((tag("ab"), tag("XY"), take(1)))` | `"abXYZ!"` | `Ok(("!", ("ab", "XY", "Z")))` | Chains parsers and assemble the sub results in a tuple. You can use as many child parsers as you can put elements in a tuple|
| [tuple](https://docs.rs/nom/latest/nom/sequence/fn.tuple.html) | `tuple((tag("ab"), tag("XY"), take(1)))` | `"abXYZ!"` | `Ok(("!", ("ab", "XY", "Z")))` | Chains parsers and assemble the sub results in a tuple. You can use as many child parsers as you can put elements in a tuple|

## Applying a parser multiple times

Expand Down

0 comments on commit a209ff1

Please sign in to comment.