Handle variables in binary ops in function calls
This commit is contained in:
parent
c5f2d04c6c
commit
7949699229
@ -143,7 +143,8 @@ pub(crate) fn eat_call_args<I: Iterator<Item = Token>>(
|
|||||||
TokenKind::Variable(_) => {
|
TokenKind::Variable(_) => {
|
||||||
let v = toks.next().unwrap();
|
let v = toks.next().unwrap();
|
||||||
devour_whitespace_or_comment(toks);
|
devour_whitespace_or_comment(toks);
|
||||||
if toks.next().unwrap().is_symbol(Symbol::Colon) {
|
if toks.peek().unwrap().is_symbol(Symbol::Colon) {
|
||||||
|
toks.next();
|
||||||
name = v.kind.to_string();
|
name = v.kind.to_string();
|
||||||
} else {
|
} else {
|
||||||
val.push(v);
|
val.push(v);
|
||||||
|
@ -48,3 +48,8 @@ test!(
|
|||||||
"@function a() {\n @return 1; @return 2;\n}\n\nb {\ncolor: a();\n}\n",
|
"@function a() {\n @return 1; @return 2;\n}\n\nb {\ncolor: a();\n}\n",
|
||||||
"b {\n color: 1;\n}\n"
|
"b {\n color: 1;\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
value_after_variable,
|
||||||
|
"$x: 0;\na {\n color: if($x != 0, a, b);\n}\n",
|
||||||
|
"a {\n color: b;\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user