summaryrefslogtreecommitdiff
path: root/chain/src/item/default
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2023-08-10 11:14:04 +0800
committerJSDurand <mmemmew@gmail.com>2023-08-10 11:14:04 +0800
commitb8a2d05a3c0d835556d5ddbd44e4a1e201302af5 (patch)
tree72e833f41b9a8ffd9d3e7216d2f158504343a420 /chain/src/item/default
parentf14c8a2aeab18a9bfa380df28f94736580e08f48 (diff)
Move the trait `Forest` to the crate "forest".
The purpose of this change is to share this trait with other crates, such as the forth-coming "semiring" crate that will be responsible for handling some simple semiring operations as well as the querying, in my plans.
Diffstat (limited to 'chain/src/item/default')
-rw-r--r--chain/src/item/default/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/chain/src/item/default/mod.rs b/chain/src/item/default/mod.rs
index de43f37..01e463e 100644
--- a/chain/src/item/default/mod.rs
+++ b/chain/src/item/default/mod.rs
@@ -200,7 +200,7 @@ impl<T: GraphLabel> Forest<T> for DefaultForest<ForestLabel<T>> {
let transformed_label = transform(vertex_label.label());
- let transformed_label = ForestLabel::new(transformed_label, vertex_label.status);
+ let transformed_label = ForestLabel::new(transformed_label, vertex_label.status());
let mut builder = PLGBuilderMut::from_graph_mut(&mut self.graph);
@@ -1239,7 +1239,7 @@ impl DefaultForest<ForestLabel<GrammarLabel>> {
label_label.set_start(pos);
- let new_label = ForestLabel::new(label_label, label.status);
+ let new_label = ForestLabel::new(label_label, label.status());
builder.set_label(node, new_label)?;
}
@@ -1306,7 +1306,7 @@ impl DefaultForest<ForestLabel<GrammarLabel>> {
label_label.set_end(pos + 1);
}
- let new_label = ForestLabel::new(label_label, label.status);
+ let new_label = ForestLabel::new(label_label, label.status());
builder.set_label(node, new_label)?;
}
@@ -1339,7 +1339,7 @@ pub fn print_labels(
let label = forest.vertex_label(node)?;
if let Some(label) = label {
- let label = label.label.label();
+ let label = label.label().label();
match label {
GrammarLabelType::TNT(tnt) => {