Skip to main content

oni_comb_parser/text/
whitespace.rs

1use crate::primitive::take_while0::TakeWhile0;
2use crate::primitive::take_while1::TakeWhile1;
3use crate::str_input::StrInput;
4use crate::text::take_while::{take_while0, take_while1};
5
6fn is_ws(c: char) -> bool {
7  c.is_ascii_whitespace()
8}
9
10pub fn whitespace0<'a>() -> TakeWhile0<fn(char) -> bool, StrInput<'a>> {
11  take_while0(is_ws as fn(char) -> bool)
12}
13
14pub fn whitespace1<'a>() -> TakeWhile1<fn(char) -> bool, StrInput<'a>> {
15  take_while1(is_ws as fn(char) -> bool)
16}