Accept trailing comma in set literal

This commit is contained in:
K. Lange 2022-07-12 06:23:16 +09:00
parent ed81bc9c03
commit 3472fcfb6b

View File

@ -3251,7 +3251,7 @@ static void dict(int exprType) {
if (check(TOKEN_COMMA) || check(TOKEN_RIGHT_BRACE)) {
/* One expression, must be a set literal. */
size_t argCount = 1;
while (match(TOKEN_COMMA)) {
while (match(TOKEN_COMMA) && !check(TOKEN_RIGHT_BRACE)) {
expression();
argCount++;
}