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
28
29
30
31
use crate::IResult;
pub(crate) fn sp(input: &str) -> IResult<&str, &str> {
recognize!(
input,
many0!(alt!(
do_parse!(tag!("//") >> take_until!("\n") >> char!('\n') >> (()))
|
map!(take_while1!(|c| c == '\t' || c == '\n' || c == '\r' || c == ' '), |_| ())
|
do_parse!(tag!("/*") >> take_until!("*/") >> tag!("*/") >> (()))
))
)
}
macro_rules! ws (
($i:expr, $($args:tt)*) => ({
use $crate::whitespace::sp;
do_parse!($i,
sp >>
s: $($args)* >>
sp >>
(s)
)
});
);