summaryrefslogtreecommitdiff
path: root/nfa/src
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2023-01-28 10:17:24 +0800
committerJSDurand <mmemmew@gmail.com>2023-01-28 10:22:57 +0800
commitf28155105134b90fd86049c65478d307e0d8dbbc (patch)
tree72b3b4872d5dba89413eca70bcaae9e421def7ee /nfa/src
parente8ea01319b3a9032a3f4f69f65e9ca96562b87b9 (diff)
a prototype of an item derivation forest
It seems to be complete now, but still awaits more tests to see where the errors are, which should be plenty, haha.
Diffstat (limited to 'nfa/src')
-rw-r--r--nfa/src/default/nfa.rs8
-rw-r--r--nfa/src/default/regex.rs4
2 files changed, 7 insertions, 5 deletions
diff --git a/nfa/src/default/nfa.rs b/nfa/src/default/nfa.rs
index 8d657d5..6b1e56f 100644
--- a/nfa/src/default/nfa.rs
+++ b/nfa/src/default/nfa.rs
@@ -147,9 +147,11 @@ impl<T: GraphLabel + Display> Nfa<T> for DefaultNFA<T> {
let mut builder: DLGBuilder<LabelType<T>> = Builder::with_capacity(nfa_len);
- for _ in 0..nfa_len {
- builder.add_vertex();
- }
+ builder.add_vertices(nfa_len);
+
+ // for _ in 0..nfa_len {
+ // builder.add_vertex();
+ // }
let default = LabelType::new(DOption(default), total_regexps_len, false);
diff --git a/nfa/src/default/regex.rs b/nfa/src/default/regex.rs
index 1e3e87b..9e1ed5c 100644
--- a/nfa/src/default/regex.rs
+++ b/nfa/src/default/regex.rs
@@ -879,9 +879,9 @@ mod test_des_rec {
use crate::desrec::DesRec;
- #[allow(dead_code, unused)]
+ #[allow(dead_code)]
fn test_scanner<'a, 'b, T>(
- parser: &'b DefaultRegParser<T>,
+ _parser: &'b DefaultRegParser<T>,
input: &'a str,
) -> Result<Option<(usize, RegexType<char>, ParseDirection)>, ParseError>
where