From d2336cb59d22fa60fac6698e87b2de55d34dbe05 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 18 Mar 2019 19:25:43 +0200 Subject: [PATCH] Implement function to build operator tree --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 64d2780..f63a799 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,6 +11,7 @@ mod value; pub use configuration::{Configuration, EmptyConfiguration, HashMapConfiguration}; pub use error::Error; pub use function::Function; +pub use tree::Node; pub use value::Value; pub fn eval(string: &str) -> Result { @@ -24,6 +25,10 @@ pub fn eval_with_configuration( tree::tokens_to_operator_tree(token::tokenize(string)?)?.eval(configuration) } +pub fn build_operator_tree(string: &str) -> Result { + tree::tokens_to_operator_tree(token::tokenize(string)?) +} + #[cfg(test)] mod test { use crate::{eval, value::Value};