(&mut self, rep: &hir::Repetition)
| 515 | } |
| 516 | |
| 517 | fn c_repeat(&mut self, rep: &hir::Repetition) -> Result { |
| 518 | use syntax::hir::RepetitionKind::*; |
| 519 | match rep.kind { |
| 520 | ZeroOrOne => self.c_repeat_zero_or_one(&rep.hir, rep.greedy), |
| 521 | ZeroOrMore => self.c_repeat_zero_or_more(&rep.hir, rep.greedy), |
| 522 | OneOrMore => self.c_repeat_one_or_more(&rep.hir, rep.greedy), |
| 523 | Range(hir::RepetitionRange::Exactly(min_max)) => { |
| 524 | self.c_repeat_range(&rep.hir, rep.greedy, min_max, min_max) |
| 525 | } |
| 526 | Range(hir::RepetitionRange::AtLeast(min)) => { |
| 527 | self.c_repeat_range_min_or_more(&rep.hir, rep.greedy, min) |
| 528 | } |
| 529 | Range(hir::RepetitionRange::Bounded(min, max)) => { |
| 530 | self.c_repeat_range(&rep.hir, rep.greedy, min, max) |
| 531 | } |
| 532 | } |
| 533 | } |
| 534 | |
| 535 | fn c_repeat_zero_or_one(&mut self, expr: &Hir, greedy: bool) -> Result { |
| 536 | let split_entry = self.insts.len(); |
no test coverage detected