allow whitespace after variable name in declaration

This commit is contained in:
ConnorSkees 2020-04-02 00:31:58 -04:00
parent b93e3c6f21
commit f5d3400666
2 changed files with 6 additions and 0 deletions

View File

@ -531,6 +531,7 @@ pub(crate) fn eat_expr<I: Iterator<Item = Token>>(
continue; continue;
} }
let name = eat_ident_no_interpolation(toks)?; let name = eat_ident_no_interpolation(toks)?;
devour_whitespace(toks);
if toks.peek().unwrap().kind == ':' { if toks.peek().unwrap().kind == ':' {
toks.next(); toks.next();
devour_whitespace(toks); devour_whitespace(toks);

View File

@ -112,3 +112,8 @@ test!(
"$input: foo;\na {\n color: $input#{\"literal\"};\n}\n", "$input: foo;\na {\n color: $input#{\"literal\"};\n}\n",
"a {\n color: foo 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"
);