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

Method exec

regex/src/pikevm.rs:102–130  ·  view source on GitHub ↗

Execute the NFA matching engine. If there's a match, `exec` returns `true` and populates the given captures accordingly.

(
        prog: &'r Program,
        cache: &ProgramCache,
        matches: &mut [bool],
        slots: &mut [Slot],
        quit_after_match: bool,
        input: I,
        start: usize,
        end

Source from the content-addressed store, hash-verified

100 /// If there's a match, `exec` returns `true` and populates the given
101 /// captures accordingly.
102 pub fn exec(
103 prog: &'r Program,
104 cache: &ProgramCache,
105 matches: &mut [bool],
106 slots: &mut [Slot],
107 quit_after_match: bool,
108 input: I,
109 start: usize,
110 end: usize,
111 ) -> bool {
112 let mut cache = cache.borrow_mut();
113 let cache = &mut cache.pikevm;
114 cache.clist.resize(prog.len(), prog.captures.len());
115 cache.nlist.resize(prog.len(), prog.captures.len());
116 let at = input.at(start);
117 Fsm {
118 prog: prog,
119 stack: &mut cache.stack,
120 input: input,
121 }.exec_(
122 &mut cache.clist,
123 &mut cache.nlist,
124 matches,
125 slots,
126 quit_after_match,
127 at,
128 end,
129 )
130 }
131
132 fn exec_(
133 &mut self,

Callers

nothing calls this directly

Calls 4

resizeMethod · 0.80
atMethod · 0.80
lenMethod · 0.45
exec_Method · 0.45

Tested by

no test coverage detected