pear::parsers

Function take_n_if

Source
pub fn take_n_if<I, F>(
    input: &mut Pear<I>,
    n: usize,
    cond: F,
) -> Result<I::Many, I>
where I: Input, F: FnMut(&I::Token) -> bool,
Expand description

Take exactly n tokens, ensuring cond holds on all n.