diff --git a/src/parser.rs b/src/parser.rs index ea2bbed..3656b0e 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -127,7 +127,7 @@ impl Parser { fn parse_unary(&mut self) -> Result { if let Some(operator) = self.expect(&[TokenType::Bang, TokenType::Minus]) { Ok(ast::ExprNode::Unary { - operator: operator.clone(), + operator, right: Box::new(self.parse_unary()?), }) } else {