rusticata_macros::combinator

Function cond_else

Source
pub fn cond_else<I, O, E: ParseError<I>, C, F, G>(
    cond: C,
    first: F,
    second: G,
) -> impl FnMut(I) -> IResult<I, O, E>
where C: Fn() -> bool, F: Parser<I, O, E>, G: Parser<I, O, E>,
Expand description

Helper macro for nom parsers: run first parser if condition is true, else second parser