diff --git a/src/args.rs b/src/args.rs index 1497d33..9bdbb7b 100644 --- a/src/args.rs +++ b/src/args.rs @@ -143,7 +143,8 @@ pub(crate) fn eat_call_args>( TokenKind::Variable(_) => { let v = toks.next().unwrap(); 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(); } else { val.push(v); diff --git a/tests/functions.rs b/tests/functions.rs index d4aac96..7f9739d 100644 --- a/tests/functions.rs +++ b/tests/functions.rs @@ -48,3 +48,8 @@ test!( "@function a() {\n @return 1; @return 2;\n}\n\nb {\ncolor: a();\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" +);