deny comma separated lists without parens as keys to map

This commit is contained in:
Connor Skees 2020-08-16 20:00:14 -04:00
parent 28a0a33d85
commit 253bc3b35f
2 changed files with 5 additions and 1 deletions

View File

@ -604,7 +604,7 @@ impl<'a> Parser<'a> {
loop {
let key =
self.parse_value(true, &|c| matches!(c.peek(), Some(Token { kind: ':', .. })))?;
self.parse_value(true, &|c| matches!(c.peek(), Some(Token { kind: ':', .. }) | Some(Token { kind: ',', .. })))?;
self.expect_char(':')?;

View File

@ -225,3 +225,7 @@ error!(
first_map_value_missing_closing_paren,
"$a: (a: b", "Error: expected \")\"."
);
error!(
denies_comma_separated_list_without_parens_as_key,
"$map: (a: 1, b, c, d: e);", "Error: expected \":\"."
);