-
-
Save rust-play/a586f02edd50d27adbd4fa60564cce6f to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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
use nom::combinator::opt; | |
use nom::multi::many0; | |
use nom::sequence::pair; | |
use nom::Parser; | |
fn make<Input, Item, Delim, E>( | |
item: impl Parser<Input, Item, E>, | |
delim: impl Parser<Input, Delim, E>, | |
) -> impl Parser<Input, (), E> | |
where | |
Input: Eq + Clone, | |
E: nom::error::ParseError<Input>, | |
{ | |
pair(opt(item), many0(pair(delim, item))).map(|(first, rest)| ()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment