aboutsummaryrefslogtreecommitdiff
path: root/src/nfa.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/nfa.rs')
-rw-r--r--src/nfa.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nfa.rs b/src/nfa.rs
index c92a6d5..692b07d 100644
--- a/src/nfa.rs
+++ b/src/nfa.rs
@@ -130,8 +130,13 @@ impl NFA {
// TODO: chars.nth() Work at O(n) consider using bytes instead of losing UTF-8 support
Trans::Symbol(ch) => match input.chars().nth(idx) {
Some(nxt) if nxt == *ch => {
+ // choose
idx += 1;
+
+ //explore
result |= self.matches_helper(self.states.get(id).unwrap(), input, idx);
+
+ // unchoose
idx -= 1;
}
None => {}