deny comma separated lists without parens as keys to map
This commit is contained in:
parent
28a0a33d85
commit
253bc3b35f
@ -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(':')?;
|
||||
|
||||
|
@ -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 \":\"."
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user