addition between number and unary ops
This commit is contained in:
parent
23390238b9
commit
b6cf00c87b
@ -9,6 +9,8 @@ impl Value {
|
|||||||
pub fn add(self, mut other: Self, span: Span) -> SassResult<Self> {
|
pub fn add(self, mut other: Self, span: Span) -> SassResult<Self> {
|
||||||
if let Self::Paren(..) = other {
|
if let Self::Paren(..) = other {
|
||||||
other = other.eval(span)?.node
|
other = other.eval(span)?.node
|
||||||
|
} else if let Self::UnaryOp(..) = other {
|
||||||
|
other = other.eval(span)?.node
|
||||||
}
|
}
|
||||||
let precedence = Op::Plus.precedence();
|
let precedence = Op::Plus.precedence();
|
||||||
Ok(match self {
|
Ok(match self {
|
||||||
|
@ -263,3 +263,8 @@ test!(
|
|||||||
"a {\n color: 1 + false;\n}\n",
|
"a {\n color: 1 + false;\n}\n",
|
||||||
"a {\n color: 1false;\n}\n"
|
"a {\n color: 1false;\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
num_plus_unary_not,
|
||||||
|
"a {\n color: 1 + not 2;\n}\n",
|
||||||
|
"a {\n color: 1false;\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user