(
&self,
mut ty: MatchNfaType,
matches: &mut [bool],
slots: &mut [Slot],
quit_after_match: bool,
text: &[u8],
start: usize,
end: usize,
| 962 | } |
| 963 | |
| 964 | fn exec_nfa( |
| 965 | &self, |
| 966 | mut ty: MatchNfaType, |
| 967 | matches: &mut [bool], |
| 968 | slots: &mut [Slot], |
| 969 | quit_after_match: bool, |
| 970 | text: &[u8], |
| 971 | start: usize, |
| 972 | end: usize, |
| 973 | ) -> bool { |
| 974 | use self::MatchNfaType::*; |
| 975 | if let Auto = ty { |
| 976 | if backtrack::should_exec(self.ro.nfa.len(), text.len()) { |
| 977 | ty = Backtrack; |
| 978 | } else { |
| 979 | ty = PikeVM; |
| 980 | } |
| 981 | } |
| 982 | match ty { |
| 983 | Auto => unreachable!(), |
| 984 | Backtrack => self.exec_backtrack(matches, slots, text, start, end), |
| 985 | PikeVM => { |
| 986 | self.exec_pikevm( |
| 987 | matches, slots, quit_after_match, text, start, end) |
| 988 | } |
| 989 | } |
| 990 | } |
| 991 | |
| 992 | /// Always run the NFA algorithm. |
| 993 | fn exec_pikevm( |
no test coverage detected