Allow trailing comma in map literal

This commit is contained in:
Lukas Werling
2015-08-31 06:41:09 -07:00
committed by Bob Nystrom
parent 6559edbc56
commit e1d3596643
2 changed files with 10 additions and 0 deletions
+3
View File
@@ -1853,6 +1853,9 @@ static void map(Compiler* compiler, bool allowAssignment)
{
ignoreNewlines(compiler);
// Map with trailing comma.
if (peek(compiler) == TOKEN_RIGHT_BRACE) break;
// Push a copy of the map since the subscript call will consume it.
emit(compiler, CODE_DUP);