From 777c20de7791fd254ce747f7d7ab4b681c5a6001 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 17 Aug 2019 18:46:00 +0200 Subject: Renaming and semantic testing --- src/runMain/kotlin/Token.kt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/runMain/kotlin/Token.kt') 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, index: Int): Token { + var i = index + 1 + while (statement[i].type == TokenType.Empty) i++ + return statement[i] +} \ No newline at end of file -- cgit v1.2.3