Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
vic1707 committed Oct 15, 2023
1 parent 00cd837 commit 1ea035c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions src/element/comp_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,16 @@ impl<'a> CompTime<'a> for UnOp<'a> {
Operator::Plus => operand,
Operator::Minus => match operand {
Element::Number(num) => Element::Number(-num),
Element::UnOp(unop) => {
match unop.op {
Operator::Plus => Element::UnOp(Box::new(UnOp::new(Operator::Minus, unop.operand))),
Operator::Minus => unop.operand,
Operator::Times
| Operator::Divide
| Operator::Power
| Operator::Modulo => unreachable!(),
}
Element::UnOp(unop) => match unop.op {
Operator::Plus => Element::UnOp(Box::new(UnOp::new(
Operator::Minus,
unop.operand,
))),
Operator::Minus => unop.operand,
Operator::Times
| Operator::Divide
| Operator::Power
| Operator::Modulo => unreachable!(),
},
Element::BinOp(_)
| Element::Function(_)
Expand Down
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::collections::HashSet;
/* Crate imports */
use crate::{
context::Context,
element::{BinOp, Element, FunctionCall, UnOp, CompTime},
element::{BinOp, CompTime, Element, FunctionCall, UnOp},
macros::{trust_me, yeet},
token::{Identifier, Operator},
utils::precedence,
Expand Down

0 comments on commit 1ea035c

Please sign in to comment.