diff options
Diffstat (limited to 'chain/src/item/default/extract.rs')
-rw-r--r-- | chain/src/item/default/extract.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/chain/src/item/default/extract.rs b/chain/src/item/default/extract.rs index 96f5119..b99c541 100644 --- a/chain/src/item/default/extract.rs +++ b/chain/src/item/default/extract.rs @@ -188,11 +188,25 @@ impl DefaultForest<ForestLabel<GrammarLabel>> { 1 => { let child = *roots_stack.first().unwrap(); - builder.add_vertex(self.vertex_label(child)?.ok_or(Error::NodeNoLabel(child))?); + // Make this a plain node. + // + // This situation will be handled properly in + // later codes. + + let plain_child_label = ForestLabel::new( + self.vertex_label(child)? + .ok_or(Error::NodeNoLabel(child))? + .label(), + ForestLabelType::Plain, + ); + + builder.add_vertex(plain_child_label); } _ => { let builder_root = builder.add_vertex(original_root_label); + // The clone indices have to be preserved so that + // we can track those nodes later. for child in roots_stack.iter().copied() { let child_node = builder.add_vertex( self.vertex_label(child)?.ok_or(Error::NodeNoLabel(child))?, |