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

Method c_repeat_zero_or_one

regex/src/compile.rs:535–547  ·  view source on GitHub ↗
(&mut self, expr: &Hir, greedy: bool)

Source from the content-addressed store, hash-verified

533 }
534
535 fn c_repeat_zero_or_one(&mut self, expr: &Hir, greedy: bool) -> Result {
536 let split_entry = self.insts.len();
537 let split = self.push_split_hole();
538 let Patch { hole: hole_rep, entry: entry_rep } = self.c(expr)?;
539
540 let split_hole = if greedy {
541 self.fill_split(split, Some(entry_rep), None)
542 } else {
543 self.fill_split(split, None, Some(entry_rep))
544 };
545 let holes = vec![hole_rep, split_hole];
546 Ok(Patch { hole: Hole::Many(holes), entry: split_entry })
547 }
548
549 fn c_repeat_zero_or_more(&mut self, expr: &Hir, greedy: bool) -> Result {
550 let split_entry = self.insts.len();

Callers 1

c_repeatMethod · 0.80

Calls 4

push_split_holeMethod · 0.80
cMethod · 0.80
fill_splitMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected