Function glue::combinators::structures::left_delimited

source ยท
pub fn left_delimited<'a, Lhs, LhsRes, Par, ParRes>(
    left: Lhs,
    parser: Par,
) -> impl Parser<'a, ParRes>
where Lhs: Parser<'a, LhsRes>, Par: Parser<'a, ParRes>,
Expand description

Match a structure with left hand delimiter.

let ctx = ParserContext::from("$123");

assert_eq!(
    left_delimited(is('$'), take(.., is(digit))).parse(ctx.clone()),
    Ok((ctx.select(1..4), "123"))
);