Function glue::combinators::finders::find_separated

source ยท
pub fn find_separated<'a, Par, ParRes, Sep, SepRes, Rep>(
    range: Rep,
    callback: Par,
    separator: Sep,
) -> impl Parser<'a, Vec<ParRes>>
where Par: Parser<'a, ParRes>, Sep: Parser<'a, SepRes>, Rep: RangeBounds<usize>,
Expand description

Parse a structure that consists of multiple parsers separated by another.

For example, comma separated values:

assert_eq!(
    find_separated(0.., is(digit), is(',')).parse("1,2,3"),
    Ok((
        ParserContext {
            input: "1,2,3",
            bounds: 4..5,
        },
        vec!["1", "2", "3"]
    ))
);