diff options
author | JSDurand <mmemmew@gmail.com> | 2023-08-04 10:12:04 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2023-08-04 10:12:04 +0800 |
commit | 7033187abaf42772097377c0a1ffc2cd4cefdada (patch) | |
tree | 4fe0801fd07d965d009570f984c88af363a5bc7e /chain/src/item/genins.rs | |
parent | 228b51fe7941e2b180ee3ea99dfea4bfcbd6770b (diff) |
minor adjustments
Not bug deals but adjustments of details.
Diffstat (limited to 'chain/src/item/genins.rs')
-rw-r--r-- | chain/src/item/genins.rs | 21 |
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) } |