Remove superfluous printlns.
This commit is contained in:
parent
4fd86751dc
commit
ab24e08f28
@ -459,12 +459,12 @@ impl Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn insert_back_prioritized(&mut self, node: Node, is_root_node: bool) -> EvalexprResult<()> {
|
fn insert_back_prioritized(&mut self, node: Node, is_root_node: bool) -> EvalexprResult<()> {
|
||||||
println!(
|
// println!(
|
||||||
"Inserting {:?} into {:?}, is_root_node = {is_root_node}",
|
// "Inserting {:?} into {:?}, is_root_node = {is_root_node}",
|
||||||
node.operator(),
|
// node.operator(),
|
||||||
self.operator()
|
// self.operator()
|
||||||
);
|
// );
|
||||||
println!("Self is {:?}", self);
|
// println!("Self is {:?}", self);
|
||||||
if self.operator().precedence() < node.operator().precedence() || node.operator().is_unary() || is_root_node
|
if self.operator().precedence() < node.operator().precedence() || node.operator().is_unary() || is_root_node
|
||||||
// Right-to-left chaining
|
// Right-to-left chaining
|
||||||
|| (self.operator().precedence() == node.operator().precedence() && !self.operator().is_left_to_right() && !node.operator().is_left_to_right())
|
|| (self.operator().precedence() == node.operator().precedence() && !self.operator().is_left_to_right() && !node.operator().is_left_to_right())
|
||||||
@ -481,17 +481,17 @@ impl Node {
|
|||||||
|| (last_child_operator.precedence()
|
|| (last_child_operator.precedence()
|
||||||
== node.operator().precedence() && !last_child_operator.is_left_to_right() && !node.operator().is_left_to_right())
|
== node.operator().precedence() && !last_child_operator.is_left_to_right() && !node.operator().is_left_to_right())
|
||||||
{
|
{
|
||||||
println!(
|
// println!(
|
||||||
"Recursing into {:?}",
|
// "Recursing into {:?}",
|
||||||
self.children.last().unwrap().operator()
|
// self.children.last().unwrap().operator()
|
||||||
);
|
// );
|
||||||
// Unwrap cannot fail because is_leaf being false and has_enough_children being true implies that the operator wants and has at least one child
|
// Unwrap cannot fail because is_leaf being false and has_enough_children being true implies that the operator wants and has at least one child
|
||||||
self.children
|
self.children
|
||||||
.last_mut()
|
.last_mut()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.insert_back_prioritized(node, false)
|
.insert_back_prioritized(node, false)
|
||||||
} else {
|
} else {
|
||||||
println!("Rotating");
|
// println!("Rotating");
|
||||||
if node.operator().is_leaf() {
|
if node.operator().is_leaf() {
|
||||||
return Err(EvalexprError::AppendedToLeafNode);
|
return Err(EvalexprError::AppendedToLeafNode);
|
||||||
}
|
}
|
||||||
@ -529,7 +529,7 @@ impl Node {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println!("Inserting as specified");
|
// println!("Inserting as specified");
|
||||||
self.children.push(node);
|
self.children.push(node);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user