Open INFCode opened 1 year ago
The master
branch contains examples for the code found on master
(which now includes the fold
combinator). For examples for nom 7.x
, check the 7.x
branch or, better yet, the exact tag of your nom version.
Thank you for pointing this out. Based on what you said, I think I've figured out what's happening here: the recipe manual is directly linking to the example file through its path on Github (https://github.com/rust-bakery/nom/blob/main/examples/string.rs), which defaults to the one in the master branch. However, as a 7.x manual, the permalink to the example (https://github.com/rust-bakery/nom/blob/869f8972a4383b13cf89574fda28cb7dbfd56517/examples/string.rs) should be used instead. Could you please update the link so that others will not get confused by this? Thanks a lot!
Prerequisites
Here are a few things you should provide to help me understand the issue:
rustc 1.70.0 (90c541806 2023-05-31)
1.7.3
alloc
Issue
It seems that the
fold
function (not thefold_many*
functions) is not present in the the document or in the choosing a combinator manual.However, it is used in the example of parsing a string, which is pointed to by the recipe. Also I can actually find the definition of
fold
in themulti
moduleI tried to copy that example code into a test project and it failed to compile, with the following error:
I am relatively new to rust, but I believe there should be some kind of inconsistency here. Either there's missing documentation, or the example needs to be updated.