diff options
Diffstat (limited to 'chain/src/item/genins.rs')
-rw-r--r-- | chain/src/item/genins.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/chain/src/item/genins.rs b/chain/src/item/genins.rs index 07dbdfb..1996545 100644 --- a/chain/src/item/genins.rs +++ b/chain/src/item/genins.rs @@ -335,7 +335,7 @@ impl DefaultForest<ForestLabel<GrammarLabel>> { if let Some(frag) = virtual_frag { let mut frag = (*frag.get(0).unwrap()).clone(); - frag.set_pos(node_label.label().start(), false)?; + frag.set_pos(atom, node_label.label().start(), false)?; let frag_nodes_len = frag.nodes_len(); @@ -720,15 +720,10 @@ impl DefaultForest<ForestLabel<GrammarLabel>> { // return Err(Error::CannotClose(nt, t, node, node_label_start)); // } - // FIXME: It is not correct to set the end of all - // nodes unconditionally here. - // - // We need to figure out the correct way to set the - // ending positions. - for frag in reduction_fragment.into_iter().flatten() { let mut frag = frag.clone(); - frag.set_pos(node_label_start, true)?; + + frag.set_pos(atom, node_label_start, true)?; node = self.plant_at_start(node, frag)?; } |