diff --git a/src/value/ops.rs b/src/value/ops.rs index 149f2ad..06c85eb 100644 --- a/src/value/ops.rs +++ b/src/value/ops.rs @@ -214,6 +214,7 @@ impl Mul for Value { } }, Self::BinaryOp(..) | Self::Paren(..) => self.eval()?, + Self::UnaryOp(..) => (self.eval()? * other)?, _ => return Err(format!("Undefined operation \"{} * {}\".", self, other).into()), }) } diff --git a/tests/values.rs b/tests/values.rs index 5956b61..9c0e330 100644 --- a/tests/values.rs +++ b/tests/values.rs @@ -463,3 +463,8 @@ test!( "a {\n color: (a b) - (1 2);\n}\n", "a {\n color: a b-1 2;\n}\n" ); +test!( + negative_number_times_number, + "a {\n color: -1 * 2;\n}\n", + "a {\n color: -2;\n}\n" +);