Small simple structure

This commit is contained in:
Rendo 2025-11-06 00:06:49 +05:00
commit e14eb1b870
4 changed files with 36 additions and 0 deletions

18
src/formula/mod.rs Normal file
View file

@ -0,0 +1,18 @@
use crate::formula::node::Node;
pub mod node;
pub struct Formula {
root: node::Node,
}
impl Formula {
pub fn new(optional_root: Option<node::Node>) -> Self {
match optional_root {
Some(root) => Formula { root },
None => Formula {
root: node::Node::empty(),
},
}
}
}

View file

@ -0,0 +1 @@
pub struct GraphBuilder;

16
src/formula/node/mod.rs Normal file
View file

@ -0,0 +1,16 @@
use crate::formula::node::graph_constructor::GraphBuilder;
mod graph_constructor;
pub struct Node {
children: Vec<Node>,
}
impl Node {
pub fn empty() -> Self {
Node { children: vec![] }
}
pub fn build() -> GraphBuilder {
GraphBuilder
}
}

1
src/lib.rs Normal file
View file

@ -0,0 +1 @@
mod formula;