Don't special-case choices2
This commit is contained in:
parent
60141dd766
commit
502bfa9587
@ -7,10 +7,7 @@ where
|
|||||||
P2: Parser<I, O, E>,
|
P2: Parser<I, O, E>,
|
||||||
I: ParserInput + Clone,
|
I: ParserInput + Clone,
|
||||||
{
|
{
|
||||||
move |input: I| match parser1.parse(input.clone()) {
|
choice((parser1, parser2))
|
||||||
ok @ Ok(..) => ok,
|
|
||||||
Err(_e) => parser2.parse(input),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn choice<C, I, O, E>(choices: C) -> (impl Parser<I, O, E>, Bnf)
|
pub fn choice<C, I, O, E>(choices: C) -> (impl Parser<I, O, E>, Bnf)
|
||||||
|
Loading…
Reference in New Issue
Block a user