Add recovery for missing comma between arguments

^KT-13497 Fixed
This commit is contained in:
Denis Zharkov
2019-01-15 15:23:04 +03:00
parent 37614254d7
commit 82537cdc8b
7 changed files with 270 additions and 50 deletions
@@ -1816,7 +1816,15 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing {
if (at(COLON) && lookahead(1) == IDENTIFIER) {
errorAndAdvance("Unexpected type specification", 2);
}
if (!at(COMMA)) break;
if (!at(COMMA)) {
if (atSet(EXPRESSION_FIRST)) {
error("Expecting ','");
continue;
}
else {
break;
}
}
advance(); // COMMA
if (at(RPAR)) {
error("Expecting an argument");