A few doc improvments to /docs and others#1832
Closed
asibahi wants to merge 3 commits intorust-bakery:mainfrom
Closed
A few doc improvments to /docs and others#1832asibahi wants to merge 3 commits intorust-bakery:mainfrom
/docs and others#1832asibahi wants to merge 3 commits intorust-bakery:mainfrom
Conversation
Geal
reviewed
Apr 19, 2025
| | [pair](https://docs.rs/nom/latest/nom/sequence/fn.pair.html) | `pair(tag("ab"), tag("XY"))` | `"abXYZ"` | `Ok(("Z", ("ab", "XY")))` |Gets an object from the first parser, then gets another object from the second parser.| | ||
| | [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")))` |Gets an object from the first parser, then matches an object from the sep_parser and discards it, then gets another object from the second parser.| | ||
| | [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| | ||
| | tuples | `((tag("ab"), tag("XY"), take(1)))` | `"abXYZ!"` | `Ok(("!", ("ab", "XY", "Z")))` | `Parser` is implemented for tuples: it 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| |
Collaborator
There was a problem hiding this comment.
why remove the doc link here?
Author
There was a problem hiding this comment.
the thought was that the tuple combinator (which is linked to) is deprecated and the examples would just use tuples immediately
ianrrees
reviewed
Jun 1, 2025
| ### getting more information: nom-language::error::VerboseError | ||
|
|
||
| The `VerboseError<I>` type accumulates more information about the chain of | ||
| The `VerboseError<I>` type (available from the companion `nom-language` crate) accumulates more information about the chain of |
There was a problem hiding this comment.
Thanks for making this PR, I've come here after trying to use the VerboseError from nom :)
Just a minor suggestion: that the struct comes from a different crate is an important piece of information, I'd not put it in a parenthetical. Maybe something like this instead:
The companion nom-language crate's VerboseError<I> type accumulates
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues: #1823 , #1801 in addition to some self-prompted fixes.
fixes #1823
fixes #1801