aboutsummaryrefslogtreecommitdiffstats
path: root/src/run
diff options
context:
space:
mode:
Diffstat (limited to 'src/run')
-rw-r--r--src/run/builtin.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/run/builtin.rs b/src/run/builtin.rs
index fd4cbed..87a0be0 100644
--- a/src/run/builtin.rs
+++ b/src/run/builtin.rs
@@ -1039,7 +1039,9 @@ impl Builtin for pish_theme {
#[cfg(debug_assertions)]
mod dbg {
- use super::*;
+ use crate::parse::regex::{dfa::DFA, enfa::ENFA};
+
+use super::*;
#[derive(Copy, Clone)]
pub struct debug;
@@ -1121,13 +1123,17 @@ mod dbg {
},
};
- match regex.try_compile() {
- Ok(compiled) => writeln!(stdout, "{compiled:?}")?,
- Err(e) => {
- writeln!(stdout, "compilation error: {e:?}")?;
+ let nfa = match ENFA::try_from(regex) {
+ Ok(nfa) => nfa,
+ Err(err) => {
+ writeln!(stdout, "nfa error: {err:?}")?;
return Err(Error::Exit(2));
- },
- }
+ }
+ };
+ writeln!(stdout, "{nfa:?}")?;
+
+ let dfa = DFA::from(nfa);
+ writeln!(stdout, "{dfa:?}")?;
Ok(())
}