summaryrefslogtreecommitdiff
path: root/chain/src/item/genins.rs
diff options
context:
space:
mode:
Diffstat (limited to 'chain/src/item/genins.rs')
-rw-r--r--chain/src/item/genins.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/chain/src/item/genins.rs b/chain/src/item/genins.rs
index d5fb678..262728f 100644
--- a/chain/src/item/genins.rs
+++ b/chain/src/item/genins.rs
@@ -212,6 +212,7 @@ impl DefaultForest<ForestLabel<GrammarLabel>> {
// Whether or not to print detailed graphs of each step of
// operation for debugging purposes.
let mut to_print = false;
+ // let mut to_print = (8..=10).contains(&pos);
if std::fs::metadata("output/").is_err() {
to_print = false;
@@ -418,6 +419,10 @@ impl DefaultForest<ForestLabel<GrammarLabel>> {
.collect();
}
+ // if pos == 9 {
+ // dbg!(&parents);
+ // }
+
let mut non_empty = false;
for atom_child in atom_child_iter {
@@ -431,6 +436,10 @@ impl DefaultForest<ForestLabel<GrammarLabel>> {
let mut stack = parents.clone();
let mut second_stack = Vec::new();
+ // if pos == 9 {
+ // dbg!(&reduction_info);
+ // }
+
// locate the nodes
for reduction_nt in reduction_info.iter().copied().flatten().rev() {
while let Some(mut node) = stack.pop() {
@@ -438,6 +447,10 @@ impl DefaultForest<ForestLabel<GrammarLabel>> {
.vertex_label(node.node())?
.ok_or_else(|| Error::NodeNoLabel(node.node()))?;
+ // if pos == 9 {
+ // dbg!(node);
+ // }
+
if matches!(
node_label
.label()
@@ -537,6 +550,10 @@ impl DefaultForest<ForestLabel<GrammarLabel>> {
return Err(Error::CannotPlant);
}
+ // if pos == 9 {
+ // dbg!(&stack);
+ // }
+
for parent in stack {
let splanted = self.splant(parent.node(), parent.edge(), fragment, non_empty)?;
@@ -650,6 +667,10 @@ impl DefaultForest<ForestLabel<GrammarLabel>> {
PaVi::Virtual(nt, t, nth_child)
};
+ // let dbg_string = format!("pos {pos} - {num} {tnt_string} result {result}");
+
+ // dbg!(dbg_string);
+
Ok(result)
}