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

Method add

regex/src/pikevm.rs:287–305  ·  view source on GitHub ↗

Follows epsilon transitions and adds them for processing to nlist, starting at and including ip.

(
        &mut self,
        nlist: &mut Threads,
        thread_caps: &mut [Option<usize>],
        ip: usize,
        at: InputAt,
    )

Source from the content-addressed store, hash-verified

285 /// Follows epsilon transitions and adds them for processing to nlist,
286 /// starting at and including ip.
287 fn add(
288 &mut self,
289 nlist: &mut Threads,
290 thread_caps: &mut [Option<usize>],
291 ip: usize,
292 at: InputAt,
293 ) {
294 self.stack.push(FollowEpsilon::IP(ip));
295 while let Some(frame) = self.stack.pop() {
296 match frame {
297 FollowEpsilon::IP(ip) => {
298 self.add_step(nlist, thread_caps, ip, at);
299 }
300 FollowEpsilon::Capture { slot, pos } => {
301 thread_caps[slot] = pos;
302 }
303 }
304 }
305 }
306
307 /// A helper function for add that avoids excessive pushing to the stack.
308 fn add_step(

Callers 2

exec_Method · 0.45
stepMethod · 0.45

Calls 3

add_stepMethod · 0.80
pushMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected