Skip to content

Commit

Permalink
refactor: Unary minus refactor (#33)
Browse files Browse the repository at this point in the history
* Refactor unary minus

* fmt applied to interpreter
  • Loading branch information
martin045k authored Mar 24, 2023
1 parent 16f948a commit 727da74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions checkr/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ impl AExpr {
}
}
AExpr::Binary(l, op, r) => op.semantic(l.semantics(m)?, r.semantics(m)?)?,
AExpr::Minus(n) => {
(n.semantics(m)?).checked_neg().ok_or(InterpreterError::ArithmeticOverflow)?
}
AExpr::Minus(n) => (n.semantics(m)?)
.checked_neg()
.ok_or(InterpreterError::ArithmeticOverflow)?,
AExpr::Function(f) => return Err(todo!("evaluating functions {f}")),
})
}
Expand Down

0 comments on commit 727da74

Please sign in to comment.