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

Method exec

regex/src/backtrack.rs:94–114  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

92 /// If there's a match, `exec` returns `true` and populates the given
93 /// captures accordingly.
94 pub fn exec(
95 prog: &'r Program,
96 cache: &ProgramCache,
97 matches: &'m mut [bool],
98 slots: &'s mut [Slot],
99 input: I,
100 start: usize,
101 end: usize,
102 ) -> bool {
103 let mut cache = cache.borrow_mut();
104 let cache = &mut cache.backtrack;
105 let start = input.at(start);
106 let mut b = Bounded {
107 prog: prog,
108 input: input,
109 matches: matches,
110 slots: slots,
111 m: cache,
112 };
113 b.exec_(start, end)
114 }
115
116 /// Clears the cache such that the backtracking engine can be executed
117 /// on some input of fixed length.

Callers

nothing calls this directly

Calls 2

atMethod · 0.80
exec_Method · 0.45

Tested by

no test coverage detected