summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chain/src/atom/default.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/chain/src/atom/default.rs b/chain/src/atom/default.rs
index 317090e..bd71c1c 100644
--- a/chain/src/atom/default.rs
+++ b/chain/src/atom/default.rs
@@ -115,6 +115,22 @@ impl DefaultAtom {
)?)
}
+ /// Print nullable nodes.
+ pub(crate) fn print_nullables(&self) {
+ print!("printing nullables for the atom: ");
+
+ for nullable in self
+ .accepting_vec
+ .iter()
+ .enumerate()
+ .filter_map(|(index, pred)| (*pred).then(|| index))
+ {
+ print!("{nullable}, ");
+ }
+
+ println!();
+ }
+
/// Print the underlying NFA.
pub fn print_nfa<S: AsRef<str>>(&self, filename: S) -> Result<(), std::io::Error> {
self.nfa.print_viz(filename.as_ref())?;