allow whitespace after trailing comma in map

This commit is contained in:
Connor Skees 2020-07-02 14:44:00 -04:00
parent e7fc6815c1
commit 5dd14794c5
2 changed files with 7 additions and 0 deletions

View File

@ -1305,6 +1305,8 @@ impl<'a, 'b: 'a> IntermediateValueIterator<'a, 'b> {
map.insert(key.node, val.node); map.insert(key.node, val.node);
devour_whitespace(paren_toks);
if paren_toks.peek().is_none() { if paren_toks.peek().is_none() {
return Ok(Spanned { return Ok(Spanned {
node: Value::Map(map), node: Value::Map(map),

View File

@ -177,3 +177,8 @@ test!(
"$foo: ((\"<\", \"%3c\"), );", "$foo: ((\"<\", \"%3c\"), );",
"" ""
); );
test!(
map_with_whitespace_after_trailing_comma,
"$a: (foo: red, ); a {\n color: inspect($a);\n}\n",
"a {\n color: (foo: red);\n}\n"
);