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

Method exec_nfa

regex/src/exec.rs:964–990  ·  view source on GitHub ↗
(
        &self,
        mut ty: MatchNfaType,
        matches: &mut [bool],
        slots: &mut [Slot],
        quit_after_match: bool,
        text: &[u8],
        start: usize,
        end: usize,

Source from the content-addressed store, hash-verified

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(

Callers 5

match_nfa_typeMethod · 0.80
shortest_nfa_typeMethod · 0.80
find_nfaMethod · 0.80
captures_nfa_typeMethod · 0.80
many_matches_atMethod · 0.80

Calls 4

should_execFunction · 0.85
exec_backtrackMethod · 0.80
exec_pikevmMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected