'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)) {
defDeclaration();
} else if (match(TOKEN_LET)) {
do {
varDeclaration();
} while (match(TOKEN_COMMA));
if (!match(TOKEN_EOL) && !match(TOKEN_EOF)) {
error("Expected EOL after variable declaration.\n");
}