         let location: Int
 
         func description(in scanner: Scanner) -> String {
-            let string = scanner.string as NSString
+            let string = NSString(string: scanner.string)
             let subString = string.substring(to: location)
             let components = subString.components(separatedBy: "\n")
             guard !components.isEmpty else { return "[line \(1)]" }

            tokens.append(token)
            tokenLocations.append(TokenLocation(scanner.scanLocation))
        }
        while !scanner.isAtEnd {
            let previousScanLocation = scanner.scanLocation
            scanBeginObject().flatMap({ appendToken($0) })

                return ([], [])
            }
        }
        #endif
        return (tokens, tokenLocations)
    }

