         return true
     }
     
-    @discardableResult private func advance() -> Character {
-        let result = source[current]
-        current = source.index(after: current)
+    @discardableResult private func advance() -> UnicodeScalar {
+        let result = source.unicodeScalars[current]
+        current = source.unicodeScalars.index(after: current)
         return result
     }
     

    }
}

private extension Character {
    var isAlpha: Bool {
        return
            (self >= "a" && self <= "z") ||

    private let source: String
    private var tokens: [Token] = []
    
    private var start: String.UnicodeScalarIndex
    private var current: String.UnicodeScalarIndex
    private var line = 1
    
    private var currentText: String {
        return String(source.unicodeScalars[start..<current])
    }

    private var isAtEnd: Bool {
        return current >= source.unicodeScalars.endIndex
    }
    
    private var peek: UnicodeScalar {
        if current >= source.unicodeScalars.endIndex { return "\0" }
        return source.unicodeScalars[current]
    }
    
    private var peekNext: UnicodeScalar {
        let next = source.unicodeScalars.index(after: current)
        if next >= source.unicodeScalars.endIndex { return "\0" }
        return source.unicodeScalars[next]
    }
    
    init(_ source: String) {
        self.source = source
        self.start = source.unicodeScalars.startIndex
        self.current = source.unicodeScalars.startIndex
    }
    
    func scanTokens() -> [Token] {
