aboutsummaryrefslogtreecommitdiff
path: root/src/nfa.rs
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-12-10 20:50:35 +0200
committeromagdy7 <omar.professional8777@gmail.com>2023-12-10 20:50:35 +0200
commit180572c70477e78c43c745d2331ebf4d39d9ff10 (patch)
treebf09fc9d4df1d5d638e339b56a69d583d2c7ee16 /src/nfa.rs
parent2419f52d434096edebab85b3fa7141bcfa584583 (diff)
downloadrex-master.tar.xz
rex-master.zip
Fixed a bug where it wouldn't match spacesHEADmaster
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 => {}