combine::parser::byte

Function letter

source
pub fn letter<Input>() -> impl Parser<Input, Output = u8, PartialState = ()>
where Input: Stream<Token = u8>,
Expand description

Parses an ASCII alphabet letter (a–z, A–Z).

use combine::Parser;
use combine::parser::byte::letter;
assert_eq!(letter().parse(&b"a"[..]), Ok((b'a', &b""[..])));
assert_eq!(letter().parse(&b"A"[..]), Ok((b'A', &b""[..])));
assert!(letter().parse(&b"9"[..]).is_err());