'let' should support multiple comma-separated declarations

This commit is contained in:
K. Lange 2021-01-04 07:40:29 +09:00
parent aa1c0c8e93
commit d1d6a7a3fe

View File

@ -592,7 +592,9 @@ static void declaration() {
if (check(TOKEN_DEF)) { if (check(TOKEN_DEF)) {
defDeclaration(); defDeclaration();
} else if (match(TOKEN_LET)) { } else if (match(TOKEN_LET)) {
varDeclaration(); do {
varDeclaration();
} while (match(TOKEN_COMMA));
if (!match(TOKEN_EOL) && !match(TOKEN_EOF)) { if (!match(TOKEN_EOL) && !match(TOKEN_EOF)) {
error("Expected EOL after variable declaration.\n"); error("Expected EOL after variable declaration.\n");
} }