blob: df5d3d27f854e888c2df19fd64207f645a16cdb7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
class Token {
lateinit var content: String
lateinit var type: TokenType
var lineNumber: Int = 0
}
/**
* Finds the next non empty token by [index]
*/
fun nextNonEmpty(statement: MutableList<Token>, index: Int): Token {
var i = index + 1
while (statement[i].type == TokenType.Empty) i++
return statement[i]
}
|