From 2ca7209d22e8b6f3c84edbe41470c545c4d2835c Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Sat, 4 May 2019 13:43:05 +0200 Subject: [PATCH] Remove debug output --- src/tree/mod.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/tree/mod.rs b/src/tree/mod.rs index 2904440..b081b94 100644 --- a/src/tree/mod.rs +++ b/src/tree/mod.rs @@ -367,7 +367,7 @@ impl Node { } fn insert_back_prioritized(&mut self, node: Node, is_root_node: bool) -> EvalexprResult<()> { - println!("Inserting {:?} into {:?}", node.operator, self.operator()); + // println!("Inserting {:?} into {:?}", node.operator, self.operator()); if self.operator().precedence() < node.operator().precedence() || is_root_node // Right-to-left chaining || (self.operator().precedence() == node.operator().precedence() && !self.operator().is_left_to_right() && !node.operator().is_left_to_right()) @@ -381,13 +381,13 @@ impl Node { || (self.children.last().unwrap().operator().precedence() == node.operator().precedence() && !self.children.last().unwrap().operator().is_left_to_right() && !node.operator().is_left_to_right()) { - println!("Recursing into {:?}", self.children.last().unwrap().operator()); + // println!("Recursing into {:?}", self.children.last().unwrap().operator()); self.children .last_mut() .unwrap() .insert_back_prioritized(node, false) } else { - println!("Rotating"); + // println!("Rotating"); if node.operator().is_leaf() { return Err(EvalexprError::AppendedToLeafNode); } @@ -400,7 +400,7 @@ impl Node { Ok(()) } } else { - println!("Inserting as specified"); + // println!("Inserting as specified"); self.children.push(node); Ok(()) } @@ -431,8 +431,8 @@ fn collapse_root_stack_to(root_stack: &mut Vec, mut root: Node, collapse_g } fn collapse_all_sequences(root_stack: &mut Vec) -> EvalexprResult<()> { - println!("Collapsing all sequences"); - println!("Initial root stack is: {:?}", root_stack); + // println!("Collapsing all sequences"); + // println!("Initial root stack is: {:?}", root_stack); let mut root = if let Some(root) = root_stack.pop() { root } else { @@ -440,7 +440,7 @@ fn collapse_all_sequences(root_stack: &mut Vec) -> EvalexprResult<()> { }; loop { - println!("Root is: {:?}", root); + // println!("Root is: {:?}", root); if root.operator() == &Operator::RootNode { root_stack.push(root); break; @@ -461,7 +461,7 @@ fn collapse_all_sequences(root_stack: &mut Vec) -> EvalexprResult<()> { } } - println!("Root stack after collapsing all sequences is: {:?}", root_stack); + // println!("Root stack after collapsing all sequences is: {:?}", root_stack); Ok(()) } @@ -535,8 +535,8 @@ pub(crate) fn tokens_to_operator_tree(tokens: Vec) -> EvalexprResult) -> EvalexprResult