Skip to content

Commit

Permalink
chore: comment dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
leogaudin committed Sep 2, 2024
1 parent d48ee14 commit ad9d921
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,26 @@ impl TreeNode {
}
}

pub fn print_tree(node: TreeNodeRef) {
let node = node.borrow();
match node.get_val() {
Some(NodeValue::Value(value)) => print!("{}", value),
Some(NodeValue::Variable(variable)) => print!("{}", variable),
Some(NodeValue::Operator('!')) => {
print!("!(");
print_tree(node.get_left().unwrap());
print!(")");
}
Some(NodeValue::Operator(operator)) => {
print!("(");
print_tree(node.get_left().unwrap());
print!("{}", operator);
print_tree(node.get_right().unwrap());
print!(")");
}
None => panic!("Node has no value"),
}
}
// pub fn print_tree(node: TreeNodeRef) {
// let node = node.borrow();
// match node.get_val() {
// Some(NodeValue::Value(value)) => print!("{}", value),
// Some(NodeValue::Variable(variable)) => print!("{}", variable),
// Some(NodeValue::Operator('!')) => {
// print!("!(");
// print_tree(node.get_left().unwrap());
// print!(")");
// }
// Some(NodeValue::Operator(operator)) => {
// print!("(");
// print_tree(node.get_left().unwrap());
// print!("{}", operator);
// print_tree(node.get_right().unwrap());
// print!(")");
// }
// None => panic!("Node has no value"),
// }
// }

pub fn create_tree(expression: &str) -> TreeNodeRef {
let mut stack: Vec<TreeNodeRef> = Vec::new();
Expand Down

0 comments on commit ad9d921

Please sign in to comment.