It’s not clear to me exactly what you’re asking.
If you are using
named! macro to create your parse functions, the types should match up in a sane way. If you’re inserting your own functions at some points (sometimes necessary), then you have to do some of the plumbing work that is otherwise handled by the macros. You may wish to use
return_error! to cause earlier returns in the error case. Normally,
nom will backtrack through parsers in an attempt to find one which succeeds in parsing.
return_error! should prevent this backtracking. I’m not sure it will help if you aren’t using
Note that the vector of results makes a lot of sense if you are returning just
Result<T,Err> from your functions - you haven’t given
many0! anything else to work with, so it’s acting like a simple
vec! macro, except it will accept zero successful arguments.
IResult<I,O>, which is an alias for
Result<(I, O), nom::Err<I, E>>. It returns this from parsers, because it passes the remaining input through the parse chain. If you aren’t using
IResult type, then you have to write out the signature I provided above yourself to get more-idiomatic results from
Without code, I’m not sure we can provide very specific help.