diff options
Diffstat (limited to 'src/runMain/kotlin/Token.kt')
-rw-r--r-- | src/runMain/kotlin/Token.kt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/runMain/kotlin/Token.kt b/src/runMain/kotlin/Token.kt index d132968..df5d3d2 100644 --- a/src/runMain/kotlin/Token.kt +++ b/src/runMain/kotlin/Token.kt @@ -3,3 +3,12 @@ class Token { 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] +}
\ No newline at end of file |