MCPcopy Create free account
hub / github.com/davidblewett/rure-python / c_repeat

Method c_repeat

regex/src/compile.rs:517–533  ·  view source on GitHub ↗
(&mut self, rep: &hir::Repetition)

Source from the content-addressed store, hash-verified

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();

Callers 1

cMethod · 0.80

Calls 5

c_repeat_zero_or_oneMethod · 0.80
c_repeat_zero_or_moreMethod · 0.80
c_repeat_one_or_moreMethod · 0.80
c_repeat_rangeMethod · 0.80

Tested by

no test coverage detected