Added template for 'when' expression and entry.

This commit is contained in:
Evgeny Gerashchenko
2012-02-02 16:04:56 +04:00
parent ce48e39d40
commit 7010f3bd8e
2 changed files with 27 additions and 8 deletions
@@ -793,11 +793,13 @@ public class JetExpressionParsing extends AbstractJetParsing {
* : whenCondition{","} "=>" element SEMI
*/
private void parseWhenEntryNotElse() {
while (true) {
while (at(COMMA)) errorAndAdvance("Expecting a when-condition");
parseWhenCondition();
if (!at(COMMA)) break;
advance(); // COMMA
if (!myJetParsing.parseIdeTemplate()) {
while (true) {
while (at(COMMA)) errorAndAdvance("Expecting a when-condition");
parseWhenCondition();
if (!at(COMMA)) break;
advance(); // COMMA
}
}
expect(ARROW, "Expecting '->' or 'when'", WHEN_CONDITION_RECOVERY_SET);
if (atSet(WHEN_CONDITION_RECOVERY_SET)) {