Function nom_supreme::multi::parse_separated_terminated_res [−][src]
pub fn parse_separated_terminated_res<Input, ParseOutput, SepOutput, TermOutput, ParseErr, Accum, FoldErr>(
parser: impl Parser<Input, ParseOutput, ParseErr>,
separator: impl Parser<Input, SepOutput, ParseErr>,
terminator: impl Parser<Input, TermOutput, ParseErr>,
init: impl FnMut() -> Accum,
fold: impl FnMut(Accum, ParseOutput) -> Result<Accum, FoldErr>
) -> impl Parser<Input, Accum, ParseErr> where
Input: Clone + InputLength,
ParseErr: ParseError<Input> + FromExternalError<Input, FoldErr>,
Expand description
Parse a series of 1 or more things, separated by some separator
, terminated
by some terminator
, folding them all together with a fallible fold function.
This function is identical to parse_separated_terminated
, except that
the fold function may return an error, which ends the parse early. See its
documentation for more details about the precise behavior of this parser.