Created
June 27, 2019 09:30
-
-
Save kali/962e26250a19a1067b4b6a3cf31e0214 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn spaced<I, O, E: nom::error::ParseError<I>, F>( | |
it: F, | |
) -> impl Fn(I) -> IResult<I, O, E> where | |
I: nom::InputTakeAtPosition, | |
<I as nom::InputTakeAtPosition>::Item: nom::AsChar + Clone, | |
F: Fn(I) -> IResult<I, O, E> { | |
delimited(space0, it, space0) | |
} | |
pub fn multispaced<I, O, E: nom::error::ParseError<I>, F>( | |
it: F, | |
) -> impl Fn(I) -> IResult<I, O, E> where | |
I: nom::InputTakeAtPosition, | |
<I as nom::InputTakeAtPosition>::Item: nom::AsChar + Clone, | |
F: Fn(I) -> IResult<I, O, E> { | |
delimited(multispace0, it, multispace0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment