-
Notifications
You must be signed in to change notification settings - Fork 808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Recipes had drifted from the implementation and weren't compiling #1695
Conversation
This 1. Adds the recipes to the doctests so that they don't drift anymore 2. Fixes them
@@ -99,7 +101,7 @@ pub fn pinline_comment<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&'a st | |||
take_until("*)"), | |||
tag("*)") | |||
) | |||
)(i) | |||
).parse(i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use parse
on all these instead of parser functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is required since #1631 has been merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nom is moving towards using traits instead of function as the main parser interface. You can still use functions though if you prefer
src/lib.rs
Outdated
@@ -466,3 +466,7 @@ pub mod number; | |||
#[cfg(feature = "docsrs")] | |||
#[cfg_attr(feature = "docsrs", cfg_attr(feature = "docsrs", doc = include_str!("../doc/nom_recipes.md")))] | |||
pub mod recipes {} | |||
|
|||
#[cfg(doctest)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not add doctest to the definition above?
it took a bit of fiddling, but now all tests are passing in CI. Thankyou for your help! |
Perfect, I hadn't added the |
This