Fix parse error when 'if' ends on a class

This commit is contained in:
K. Lange 2022-07-09 21:10:36 +09:00
parent 95c6f17a21
commit 17a6aaf8d6

View File

@ -1882,9 +1882,9 @@ static void ifStatement(void) {
endScope(); endScope();
} }
} else if (!check(TOKEN_EOF) && !check(TOKEN_EOL)) { } else if (!check(TOKEN_EOF) && !check(TOKEN_EOL)) {
krk_ungetToken(parser.current);
parser.current = parser.previous;
if (blockWidth) { if (blockWidth) {
krk_ungetToken(parser.current);
parser.current = parser.previous;
parser.previous = previous; parser.previous = previous;
} }
} else { } else {