Function chumsky::text::whitespace
source · [−]Expand description
A parser that accepts (and ignores) any number of whitespace characters.
The output type of this parser is ()
.
Examples
let whitespace = text::whitespace::<_, Simple<char>>();
// Any amount of whitespace is parsed...
assert_eq!(whitespace.parse(" \t \n\n \t "), Ok(()));
// ...including none at all!
assert_eq!(whitespace.parse(""), Ok(()));