     }
     
     func scanTokens() -> [Token] {
-        while (!isAtEnd()) {
+        while (!isAtEnd) {
             start = current
             scanToken()
         }
         
         tokens.append(Token(.EOF, "", NSNull(), line))
         return tokens
-    }
-    
-    private func isAtEnd() -> Bool {
-        return current >= source.endIndex
     }
     
     private func scanToken() {

    }
    
    private func addToken(_ type: TokenType, _ literal: Any) {
        let text = source[start..<current]
        tokens.append(Token(type, text, literal, line))
    }
}

            
        case "/":
            if match("/") {
                while (peek != "\n" && !isAtEnd) { _ = advance() }
            } else {
                addToken(.SLASH)
            }
