From 32a04f1e677cfa2b4f62a2c1db358588b78d593d Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 23 Oct 2021 00:38:57 +0200 Subject: Remove Plus unary op and implement other unary ops --- src/interpret/walker.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/interpret/walker.rs') diff --git a/src/interpret/walker.rs b/src/interpret/walker.rs index e04b5a4..7684747 100644 --- a/src/interpret/walker.rs +++ b/src/interpret/walker.rs @@ -87,9 +87,8 @@ impl Walker { let value = self.walk_expression(right)?; let new_value = match op { - UnOp::Plus => value, - UnOp::Minus => todo!(), - UnOp::Not => todo!("Implement boolean arithmetic."), + UnOp::Minus => value.neg()?, + UnOp::Not => value.not()?, }; Ok(new_value) -- cgit 1.4.1