pub fn cond_else<I, O, E, C, F, G>(
cond: C,
first: F,
second: G,
) -> impl FnMut(I) -> IResult<I, O, E>where
E: ParseError<I>,
C: Fn() -> bool,
F: Parser<I, Output = O, Error = E>,
G: Parser<I, Output = O, Error = E>,
Expand description
Helper macro for nom parsers: run first parser if condition is true, else second parser