2020-04-21 06:09:43 +00:00
|
|
|
use nom::{bytes::complete::take_while, IResult};
|
2020-04-21 03:15:13 +00:00
|
|
|
|
|
|
|
fn is_whitespace(input: char) -> bool {
|
|
|
|
input == ' ' || input == '\n' || input == '\t' || input == '\r'
|
|
|
|
}
|
|
|
|
|
2020-04-21 06:07:03 +00:00
|
|
|
/// Eat whitespace, returning it
|
|
|
|
pub fn eat_whitespace(input: &str) -> IResult<&str, &str> {
|
|
|
|
let (input, whitespace) = take_while(is_whitespace)(input)?;
|
|
|
|
Ok((input, whitespace))
|
2020-04-21 03:15:13 +00:00
|
|
|
}
|