     private func generateTokens() -> [Token] {
 
         func scanBeginObject() -> Token? {
-            if scanner.scanString("{", into: nil) {
-                return .beginObject("{")
-            }
-            return nil
-        }
-
+            return scanner.scanString("{", into: nil) ? .beginObject("{") : nil
+        }
         func scanEndObject() -> Token? {
-            if scanner.scanString("}", into: nil) {
-                return .endObject("}")
-            }
-            return nil
-        }
-
+            return scanner.scanString("}", into: nil) ? .endObject("}") : nil
+        }
         func scanBeginArray() -> Token? {
-            if scanner.scanString("[", into: nil) {
-                return .beginArray("[")
-            }
-            return nil
-        }
-
+            return scanner.scanString("[", into: nil) ? .beginArray("[") : nil
+        }
         func scanEndArray() -> Token? {
-            if scanner.scanString("]", into: nil) {
-                return .endArray("]")
-            }
-            return nil
-        }
-
+            return scanner.scanString("]", into: nil) ? .endArray("]") : nil
+        }
         func scanColon() -> Token? {
-            if scanner.scanString(":", into: nil) {
-                return .colon(":")
-            }
-            return nil
-        }
-
+            return scanner.scanString(":", into: nil) ? .colon(":") : nil
+        }
         func scanComma() -> Token? {
-            if scanner.scanString(",", into: nil) {
-                return .comma(",")
-            }
-            return nil
-        }
-
+            return scanner.scanString(",", into: nil) ? .comma(",") : nil
+        }
         func scanBool() -> Token? {
-            if scanner.scanString("true", into: nil) {
-                return .bool(true)
-            }
-            if scanner.scanString("false", into: nil) {
-                return .bool(false)
-            }
-            return nil
-        }
-
+            if scanner.scanString("true", into: nil) { return .bool(true) }
+            if scanner.scanString("false", into: nil) { return .bool(false) }
+            return nil
+        }
         func scanNumber() -> Token? {
             var string: NSString?
             if scanner.scanCharacters(from: numberScanningSet, into: &string) {

            }
            return nil
        }

        func scanNull() -> Token? {
            if scanner.scanString("null", into: nil) {
                return .null
            }
            return nil
        }

        var tokens = [Token]()
        while !scanner.isAtEnd {
            let previousScanLocation = scanner.scanLocation
            if let token = scanBeginObject() {
                tokens.append(token)
            }
            if let token = scanEndObject() {
                tokens.append(token)
            }
            if let token = scanBeginArray() {
                tokens.append(token)
            }
            if let token = scanEndArray() {
                tokens.append(token)
            }
            if let token = scanColon() {
                tokens.append(token)
            }
            if let token = scanComma() {
                tokens.append(token)
            }
            if let token = scanBool() {
                tokens.append(token)
            }
            if let token = scanNumber() {
                tokens.append(token)
            }
            if let token = scanString() {
                tokens.append(token)
            }
            if let token = scanNull() {
                tokens.append(token)
            }
            let currentScanLocation = scanner.scanLocation
            guard currentScanLocation > previousScanLocation else {
                print("Not found valid token")

            }
            return nil
        }
        func scanString() -> Token? {
            if scanner.scanString("\"\"", into: nil) { return .string("") }
            var string: NSString?
            if scanner.scanString("\"", into: nil) &&
                scanner.scanCharacters(from: stringScanningSet, into: &string) &&
                scanner.scanString("\"", into: nil) {
