[][src]Function lip::any_char

pub fn any_char<'a, S: Clone + 'a>() -> impl Parser<'a, char, S>

Match any single character, usually used together with pred.

Exmaple:

pub fn whole_decimal<'a, S: Clone + 'a>() -> impl Parser<'a, usize, S> {
  one_or_more(
    any_char().pred(
    | character |
      character.is_digit(10)
    , "a whole decimal number"
    )
  ).map(| digits | digits.iter().collect::<String>().parse().unwrap())
}

The above uses any_char coupled with pred to parse a whole decimal number. See whole_decimal for more details.