elect
11/23/2017, 3:14 PMparser.currentToken to a new variable?
var n = parser.advanceToNextToken() ?: parseError("unexpected end of file") // n type Token
while (n.type != Tt.CLOSE_BRACKET) {
if (n.type != Tt.KEY) parseError("unexpected token, expected TOK_KEY", n)
elements[n.stringContents] = Element(n, parser)
n = parser.currentToken ?: kotlin.run {
if (topLevel) break // error
parseError("unexpected end of file", parser.lastToken)
}
}