allow negative numbers multiplication
This commit is contained in:
parent
8f96a821f7
commit
6608fe3f2f
@ -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()),
|
||||
})
|
||||
}
|
||||
|
@ -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"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user