rowan_nom

Function expect

Source
pub fn expect<'slice, 'src: 'slice, Lang: Language, E: RowanNomError<Lang>>(
    parser: impl Parser<Input<'slice, 'src, Lang>, Children<Lang, E>, E>,
    message: &'static str,
) -> impl FnMut(Input<'slice, 'src, Lang>) -> IResult<'slice, 'src, Lang, E, E>
where Lang::Kind: 'static,
Expand description

Tries to apply the given parser to the input without failing on error

If the provided parser fails, an error is produced with the message description and the input is left unchanged.