diff --git a/src/parse/value/parse.rs b/src/parse/value/parse.rs index 525e831..bc9e2b1 100644 --- a/src/parse/value/parse.rs +++ b/src/parse/value/parse.rs @@ -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(':')?; diff --git a/tests/map.rs b/tests/map.rs index c0c3cd0..2baa05c 100644 --- a/tests/map.rs +++ b/tests/map.rs @@ -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 \":\"." +);