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) } 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) } while (statement[statement.size - 1].second == TokenType.Empty) { statement.removeAt(statement.size - 1) } } }