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

Method c_capture

regex/src/compile.rs:365–380  ·  view source on GitHub ↗
(&mut self, first_slot: usize, expr: &Hir)

Source from the content-addressed store, hash-verified

363 }
364
365 fn c_capture(&mut self, first_slot: usize, expr: &Hir) -> Result {
366 if self.num_exprs > 1 || self.compiled.is_dfa {
367 // Don't ever compile Save instructions for regex sets because
368 // they are never used. They are also never used in DFA programs
369 // because DFAs can't handle captures.
370 self.c(expr)
371 } else {
372 let entry = self.insts.len();
373 let hole = self.push_hole(InstHole::Save { slot: first_slot });
374 let patch = self.c(expr)?;
375 self.fill(hole, patch.entry);
376 self.fill_to_next(patch.hole);
377 let hole = self.push_hole(InstHole::Save { slot: first_slot + 1 });
378 Ok(Patch { hole: hole, entry: entry })
379 }
380 }
381
382 fn c_dotstar(&mut self) -> Result {
383 Ok(if !self.compiled.only_utf8() {

Callers 3

compile_oneMethod · 0.80
compile_manyMethod · 0.80
cMethod · 0.80

Calls 5

cMethod · 0.80
push_holeMethod · 0.80
fillMethod · 0.80
fill_to_nextMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected