diff --git a/src/choice.rs b/src/choice.rs index 069136f..271d319 100644 --- a/src/choice.rs +++ b/src/choice.rs @@ -47,3 +47,28 @@ where choice_loop(input, &[&self.0, &self.1, &self.2]) } } + +impl Choice for (P1, P2, P3, P4) +where + P1: Parser, + P2: Parser, + P3: Parser, + P4: Parser, +{ + fn parse_choice(&self, input: I) -> Result<(O, I), (E, I)> { + choice_loop(input, &[&self.0, &self.1, &self.2, &self.3]) + } +} + +impl Choice for (P1, P2, P3, P4, P5) +where + P1: Parser, + P2: Parser, + P3: Parser, + P4: Parser, + P5: Parser, +{ + fn parse_choice(&self, input: I) -> Result<(O, I), (E, I)> { + choice_loop(input, &[&self.0, &self.1, &self.2, &self.3, &self.4]) + } +}