Remove the broken trailing comma logic from new map literals
GITHUB_BREAKING_CHANGES=none
@@ -3505,13 +3505,11 @@ private ExprNode GlobalOrFunctionOrMapLiteral() :
// for malformed proto init literals confusing. So use a lookahead to parse the map literals
// separately.
(LOOKAHEAD({ident.identifier().equals("map")} )
- ((
+ [
key = Expr()
<COLON>
val = Expr()
- {
- kvPairs.put(key, val);
- })?
+ { kvPairs.put(key, val); }
(
<COMMA>
key = Expr()
@@ -3519,8 +3517,7 @@ private ExprNode GlobalOrFunctionOrMapLiteral() :
val = Expr()
{ kvPairs.put(key, val); }
)*
- (<COMMA>)? // optional trailing comma
- )
+ ]
closeParen = <RPAREN>
{
// Note: the case where there are no keys or values is ambiguous.
