Function lip::chomp_while0c [−][src]
pub fn chomp_while0c<'a, F: 'a, S: Clone + 'a>(
predicate: F,
expecting: &'a str
) -> BoxedParser<'a, (), S> where
F: Fn(&char) -> bool,
Expand description
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_while0c(|c: &char| *c == ' ', "a whitespace")
}
See variable for how this can be used to chomp variable names.