1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use super::*;
pub fn inline_wsp<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&'a str, &'a str, E> {
const CHARS: &str = " \t";
take_while(|c| CHARS.contains(c))(i)
}
pub fn multiline_wsp<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&'a str, &'a str, E> {
const CHARS: &str = " \t\r\n";
take_while(|c| CHARS.contains(c))(i)
}
pub fn ignore_inline_wsp<'a, O, E: ParseError<&'a str>, F>(
f: F,
) -> impl Fn(&'a str) -> IResult<&'a str, O, E>
where
F: Fn(&'a str) -> IResult<&'a str, O, E>,
{
move |input: &'a str| {
let (input, _) = opt(inline_wsp)(input)?;
f(input)
}
}