From ef3ef65e3c6d1cb1b799b8d65847e6f4f228ca3c Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Sat, 2 Dec 2023 01:40:49 +0200 Subject: NFA implementation with support for kleene*, union and simple concatination using thomposon's construction with simulation function that matches a given regex --- src/regex.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/regex.rs') diff --git a/src/regex.rs b/src/regex.rs index 66214c0..c2465aa 100644 --- a/src/regex.rs +++ b/src/regex.rs @@ -1,4 +1,4 @@ -#![allow(dead_code, unused_variables, unused_mut)] +#![allow(dead_code, unused_variables, unused_macros, unused_mut)] macro_rules! Sym { ($c:expr) => { @@ -134,6 +134,7 @@ impl Regex { _ => { let right = Self::parse_token(chars); if let RegexToken::None = right { + // do nothing } else { *left = RegexToken::Concat((Box::new(left.clone()), Box::new(right))); } -- cgit v1.2.3