From b8a2d05a3c0d835556d5ddbd44e4a1e201302af5 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Thu, 10 Aug 2023 11:14:04 +0800 Subject: 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. --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 3483847..69be41f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,10 +9,12 @@ use chain::{atom::DefaultAtom, default::DefaultChain, Chain}; use grammar::Grammar; // For printing forests -use chain::item::{default::DefaultForest, ForestLabel, ForestLabelType}; +use chain::item::default::DefaultForest; use grammar::{GrammarLabel, TNT}; use graph::LabelGraph; +use forest::{ForestLabel, ForestLabelType}; + /// This struct is the representation of a parser. /// /// When the user constructs a parser, an instance of this struct will @@ -485,7 +487,7 @@ extern "C" fn parser_parse( Ok(forest) => { Box::leak(parser_box); - let mut bytes = bytes::forest_to_bytes(&forest); + let mut bytes = forest::forest_to_bytes(&forest); let bytes_len = bytes.len().to_be_bytes().to_vec(); @@ -835,5 +837,3 @@ extern "C" fn print_forest_node(forest: *mut CForest, node: *mut std::os::raw::c println!("node {node} has label {label}"); } - -pub mod bytes; -- cgit v1.2.3-18-g5258