From f5d34006669c52fc1339aa466622606082025b87 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Thu, 2 Apr 2020 00:31:58 -0400 Subject: [PATCH] allow whitespace after variable name in declaration --- src/lib.rs | 1 + tests/variables.rs | 5 +++++ 2 files changed, 6 insertions(+) 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" +);