[][src]Function lip::chomp_while0

pub fn chomp_while0<'a, F: 'a, S: Clone + 'a>(
    predicate: F,
    expecting: &'a str
) -> BoxedParser<'a, (), S> where
    F: Fn(&char) -> bool

Chomp zero or more characters if they pass the test.

This is commonly useful for chomping whiespaces and variable names:

fn space0<'a, S: Clone + 'a>() -> impl Parser<'a, (), S> {
  chomp_while0(|c: &char| *c == ' ', "a whitespace")
}

See variable for how this can be used to chomp variable names.