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
| 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, |