NO_SEMICOLON_BEFORE.add(SCLTerminals.EOF);
NO_SEMICOLON_BEFORE.add(SCLTerminals.SYMBOL);
NO_SEMICOLON_BEFORE.add(SCLTerminals.THEN);
+ NO_SEMICOLON_BEFORE.add(SCLTerminals.ELSE);
NO_SEMICOLON_BEFORE.add(SCLTerminals.IN);
NO_SEMICOLON_BEFORE.add(SCLTerminals.RBRACE);
NO_SEMICOLON_BEFORE.add(SCLTerminals.RBRACKET);
int loc = Locations.endOf(prevToken.location);
push(new Token(SCLTerminals.RBRACE, loc, loc, "implicit }"));
}
- if(indentations.get(indentations.size()-1) == level && symbolId != SCLTerminals.ELSE)
+ if(indentations.get(indentations.size()-1) == level)
push(new Token(SCLTerminals.SEMICOLON, symbolStart, symbolStart, "implicit ;"));
}
}
case SCLTerminals.RBRACE:
case SCLTerminals.RPAREN:
case SCLTerminals.RBRACKET:
- //case SCLTerminals.ELSE:
+ case SCLTerminals.ELSE:
case SCLTerminals.IN:
int removedToken = SCLTerminals.EOF;
while(!indentations.isEmpty()) {
}
if(indentations.isEmpty())
throw error(symbolStart, symbolEnd, "No corresponding opening parenthesis for '" + symbol.text + "'.");
- if(symbolId == SCLTerminals.THEN && removedToken == SCLTerminals.WHEN)
- curToken = symbol = new Token(SCLTerminals.THEN_AFTER_WHEN, symbol.location, symbol.text);
+ if(symbolId == SCLTerminals.THEN) {
+ if(removedToken == SCLTerminals.WHEN)
+ curToken = symbol = new Token(SCLTerminals.THEN_AFTER_WHEN, symbol.location, symbol.text);
+ else {
+ indentations.add(-1);
+ indentationTokens.add(SCLTerminals.THEN);
+ }
+ }
push(symbol);
- //if(symbolId == SCLTerminals.THEN)
- // indentations.add(-1);
return;
case SCLTerminals.EOF:
while(indentations.size() > 1 && indentations.get(indentations.size()-1) >= 0) {