From 0627e0ac4bd237f0d7d256f1cfe863440b318f55 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 15 Aug 2019 00:25:25 +0200 Subject: Added documentation --- src/runMain/kotlin/Syntax.kt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/runMain/kotlin/Syntax.kt') diff --git a/src/runMain/kotlin/Syntax.kt b/src/runMain/kotlin/Syntax.kt index 46f2306..ace7280 100644 --- a/src/runMain/kotlin/Syntax.kt +++ b/src/runMain/kotlin/Syntax.kt @@ -1,4 +1,7 @@ class Syntax { + /** + * Checks and validates whether the code complies with the syntax/grammar rules + */ fun check(statements: MutableList>>): Boolean { for (statement in statements) { removePadding(statement) @@ -6,6 +9,9 @@ class Syntax { return true } + /** + * Removed empty characters from the start and end of statements + */ private fun removePadding(statement: MutableList>) { while (statement[0].second == TokenType.Empty) { statement.removeAt(0) -- cgit v1.2.3