diff --git a/src/lib.rs b/src/lib.rs index 0eb3808..95be267 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -531,6 +531,7 @@ pub(crate) fn eat_expr>( continue; } let name = eat_ident_no_interpolation(toks)?; + devour_whitespace(toks); if toks.peek().unwrap().kind == ':' { toks.next(); devour_whitespace(toks); diff --git a/tests/variables.rs b/tests/variables.rs index 279b687..4ad1d19 100644 --- a/tests/variables.rs +++ b/tests/variables.rs @@ -112,3 +112,8 @@ test!( "$input: foo;\na {\n color: $input#{\"literal\"};\n}\n", "a {\n color: foo literal;\n}\n" ); +test!( + whitespace_after_variable_name_in_declaration, + "a {\n $x : true;\n color: $x;\n}\n", + "a {\n color: true;\n}\n" +);