     private let source: String
     private var tokens: [Token] = []
     
-    private var start = 0
-    private var current = 0
+    private var start: String.Index
+    private var current: String.Index
     private var line = 1
     
     init(_ source: String) {
         self.source = source
+        self.start = source.startIndex
+        self.current = source.startIndex
     }
     
     func scanTokens() -> [Token] {

    }
    
    private func addToken(_ type: TokenType, _ literal: Any) {
        let cs = source.characters
        let startIdx = cs.index(cs.startIndex, offsetBy: start)
        let currentIdx = cs.index(cs.startIndex, offsetBy: current)
        let text = String(cs[startIdx..<currentIdx])
        tokens.append(Token(type, text, literal, line))
    }
}

    }
    
    private func advance() -> Character {
        let result = source[current]
        current = source.index(after: current)
        return result
    }
    
    private func addToken(_ type: TokenType) {
