├── .gitignore ├── .spi.yml ├── .swiftpm └── xcode │ ├── package.xcworkspace │ └── contents.xcworkspacedata │ └── xcshareddata │ └── xcschemes │ ├── ExtractCaseValue-Package.xcscheme │ ├── ExtractCaseValue.xcscheme │ └── ExtractCaseValueClient.xcscheme ├── LICENSE ├── Package.resolved ├── Package.swift ├── README.md ├── Sources ├── ExtractCaseValue │ ├── Documentation.docc │ │ ├── Documentation.md │ │ └── Resources │ │ │ ├── fix-it@2x.png │ │ │ ├── fix-it~dark@2x.png │ │ │ ├── sample-one@2x.png │ │ │ ├── sample-one~dark@2x.png │ │ │ ├── sample-three@2x.png │ │ │ ├── sample-three~dark@2x.png │ │ │ ├── sample-two@2x.png │ │ │ └── sample-two~dark@2x.png │ └── ExtractCaseValue.swift ├── ExtractCaseValueClient │ └── main.swift └── ExtractCaseValueMacros │ ├── CaseExtractionKind.swift │ ├── Diagnostics.swift │ ├── ExtractCaseValueMacro.swift │ ├── Plugin.swift │ └── SwiftSyntax+Extensions.swift ├── Tests └── ExtractCaseValueTests │ └── ExtractCaseValueTests.swift └── docs ├── .nojekyll ├── css ├── chunk-2f6c85d7.a2bfd365.css ├── documentation-topic.f9c0a5b2.css ├── documentation-topic~topic.b6287bcf.css ├── documentation-topic~topic~tutorials-overview.e4e00aa4.css ├── index.d1ba4e57.css ├── topic.ace42ae9.css └── tutorials-overview.f0ea4317.css ├── data └── documentation │ ├── extractcasevalue.json │ └── extractcasevalue │ ├── documentation.json │ ├── extractcasevalue(name:kind:).json │ └── extractcasevalue(name:kind:defaultvalue:).json ├── developer-og-twitter.jpg ├── developer-og.jpg ├── documentation └── extractcasevalue │ ├── documentation │ └── index.html │ ├── extractcasevalue(name:kind:) │ └── index.html │ ├── extractcasevalue(name:kind:defaultvalue:) │ └── index.html │ └── index.html ├── favicon.ico ├── favicon.svg ├── images ├── fix-it@2x.png ├── fix-it~dark@2x.png ├── sample-one@2x.png ├── sample-one~dark@2x.png ├── sample-three@2x.png ├── sample-three~dark@2x.png ├── sample-two@2x.png └── sample-two~dark@2x.png ├── img ├── added-icon.d6f7e47d.svg ├── deprecated-icon.015b4f17.svg ├── modified-icon.f496e73d.svg └── no-image@2x.df2a0a50.png ├── index.html ├── index └── index.json ├── js ├── chunk-2d0d3105.cd72cc8e.js ├── chunk-2f6c85d7.98346996.js ├── chunk-vendors.ba2dd0cb.js ├── documentation-topic.3cc7023b.js ├── documentation-topic~topic.83ff84d7.js ├── documentation-topic~topic~tutorials-overview.3c0291dc.js ├── highlight-js-bash.1b52852f.js ├── highlight-js-c.d1db3f17.js ├── highlight-js-cpp.eaddddbe.js ├── highlight-js-css.75eab1fe.js ├── highlight-js-custom-markdown.7cffc4b3.js ├── highlight-js-custom-swift.5cda5c20.js ├── highlight-js-diff.62d66733.js ├── highlight-js-http.163e45b6.js ├── highlight-js-java.8326d9d8.js ├── highlight-js-javascript.acb8a8eb.js ├── highlight-js-json.471128d2.js ├── highlight-js-llvm.6100b125.js ├── highlight-js-markdown.90077643.js ├── highlight-js-objectivec.bcdf5156.js ├── highlight-js-perl.757d7b6f.js ├── highlight-js-php.cc8d6c27.js ├── highlight-js-python.c214ed92.js ├── highlight-js-ruby.f889d392.js ├── highlight-js-scss.62ee18da.js ├── highlight-js-shell.dd7f411f.js ├── highlight-js-swift.84f3e88c.js ├── highlight-js-xml.9c3688c7.js ├── index.02042140.js ├── topic.5118d6d1.js └── tutorials-overview.5febd41b.js └── metadata.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | 28 | ## App packaging 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | # Package.pins 42 | # Package.resolved 43 | # *.xcodeproj 44 | # 45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 46 | # hence it is not needed unless you have added a package configuration file to your project 47 | # .swiftpm 48 | 49 | .build/ 50 | 51 | # CocoaPods 52 | # 53 | # We recommend against adding the Pods directory to your .gitignore. However 54 | # you should judge for yourself, the pros and cons are mentioned at: 55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 56 | # 57 | # Pods/ 58 | # 59 | # Add this line if you want to avoid checking in source code from the Xcode workspace 60 | # *.xcworkspace 61 | 62 | # Carthage 63 | # 64 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 65 | # Carthage/Checkouts 66 | 67 | Carthage/Build/ 68 | 69 | # Accio dependency management 70 | Dependencies/ 71 | .accio/ 72 | 73 | # fastlane 74 | # 75 | # It is recommended to not store the screenshots in the git repo. 76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 77 | # For more information about the recommended setup visit: 78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 79 | 80 | fastlane/report.xml 81 | fastlane/Preview.html 82 | fastlane/screenshots/**/*.png 83 | fastlane/test_output 84 | 85 | # Code Injection 86 | # 87 | # After new code Injection tools there's a generated folder /iOSInjectionProject 88 | # https://github.com/johnno1962/injectionforxcode 89 | 90 | iOSInjectionProject/ 91 | -------------------------------------------------------------------------------- /.spi.yml: -------------------------------------------------------------------------------- 1 | version: 1 2 | builder: 3 | configs: 4 | - platform: ios 5 | scheme: ExtractCaseValue 6 | - platform: macos-xcodebuild 7 | scheme: ExtractCaseValue 8 | - platform: tvos 9 | scheme: ExtractCaseValue 10 | - platform: watchos 11 | scheme: ExtractCaseValue 12 | - documentation_targets: [ExtractCaseValue] 13 | swift_version: 5.9 14 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.swiftpm/xcode/xcshareddata/xcschemes/ExtractCaseValue-Package.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 11 | 14 | 15 | 16 | 17 | 18 | 24 | 30 | 31 | 32 | 38 | 44 | 45 | 46 | 52 | 58 | 59 | 60 | 61 | 62 | 68 | 69 | 71 | 77 | 78 | 79 | 80 | 81 | 91 | 92 | 98 | 99 | 100 | 101 | 107 | 108 | 114 | 115 | 116 | 117 | 119 | 120 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /.swiftpm/xcode/xcshareddata/xcschemes/ExtractCaseValue.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 42 | 43 | 49 | 50 | 56 | 57 | 58 | 59 | 61 | 62 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /.swiftpm/xcode/xcshareddata/xcschemes/ExtractCaseValueClient.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 68 | 70 | 76 | 77 | 78 | 79 | 85 | 87 | 93 | 94 | 95 | 96 | 98 | 99 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Alex Türk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "swift-syntax", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/apple/swift-syntax.git", 7 | "state" : { 8 | "revision" : "165fc6d22394c1168ff76ab5d951245971ef07e5", 9 | "version" : "509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-06-05-a" 10 | } 11 | } 12 | ], 13 | "version" : 2 14 | } 15 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.9 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | import CompilerPluginSupport 6 | 7 | let package = Package( 8 | name: "ExtractCaseValue", 9 | platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .macCatalyst(.v13)], 10 | products: [ 11 | // Products define the executables and libraries a package produces, making them visible to other packages. 12 | .library( 13 | name: "ExtractCaseValue", 14 | targets: ["ExtractCaseValue"] 15 | ), 16 | .executable( 17 | name: "ExtractCaseValueClient", 18 | targets: ["ExtractCaseValueClient"] 19 | ), 20 | ], 21 | dependencies: [ 22 | // Depend on the latest Swift 5.9 prerelease of SwiftSyntax 23 | .package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0-swift-5.9-DEVELOPMENT-SNAPSHOT-2023-04-25-b") 24 | ], 25 | targets: [ 26 | // Targets are the basic building blocks of a package, defining a module or a test suite. 27 | // Targets can depend on other targets in this package and products from dependencies. 28 | // Macro implementation that performs the source transformation of a macro. 29 | .macro( 30 | name: "ExtractCaseValueMacros", 31 | dependencies: [ 32 | .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), 33 | .product(name: "SwiftCompilerPlugin", package: "swift-syntax") 34 | ] 35 | ), 36 | 37 | // Library that exposes a macro as part of its API, which is used in client programs. 38 | .target(name: "ExtractCaseValue", dependencies: ["ExtractCaseValueMacros"]), 39 | 40 | // A client of the library, which is able to use the macro in its own code. 41 | .executableTarget(name: "ExtractCaseValueClient", dependencies: ["ExtractCaseValue"]), 42 | 43 | // A test target used to develop the macro implementation. 44 | .testTarget( 45 | name: "ExtractCaseValueTests", 46 | dependencies: [ 47 | "ExtractCaseValueMacros", 48 | .product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"), 49 | ] 50 | ), 51 | ] 52 | ) 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # extract-case-value 2 | [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffruitcoder%2Fextract-case-value%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/fruitcoder/extract-case-value) 3 | 4 | A Swift macro that extracts associated values from enum cases 5 | 6 | Documentation: [swiftpackgeindex](https://fruitcoder.github.io/extract-case-value/documentation/extractcasevalue) 7 | -------------------------------------------------------------------------------- /Sources/ExtractCaseValue/Documentation.docc/Documentation.md: -------------------------------------------------------------------------------- 1 | # ExtractCaseValue 2 | 3 | The `ExtractCaseValue` package provides a macro to expose assiocated values from enum cases as a computed property. 4 | 5 | @Metadata { 6 | @PageColor(blue) 7 | } 8 | 9 | ## Overview 10 | 11 | @Row { 12 | @Column { 13 | To extract a simple value annotate an enum with the `ExtractCaseValue` macro and provide the expected type as a generic along with a name for the comuted property. This will use the `.firstMatchingType` as a default to use the first associated value in a case that matches the expected type (in this case `String`). 14 | } 15 | @Column { 16 | ![Screenshot of Xcode showing the marco expansion on a Path enum with a String as return type](sample-one) 17 | } 18 | } 19 | 20 | @Row { 21 | @Column { 22 | If the return type is optional the macro will infer `nil` as the default value. 23 | } 24 | @Column { 25 | ![Screenshot of Xcode showing the marco expansion on a JSON enum with an optional String as return type](sample-two) 26 | } 27 | } 28 | 29 | @Row { 30 | @Column { 31 | ![Screenshot of Xcode showing the fix-it](fix-it) 32 | } 33 | @Column { 34 | Otherwise, you will get a fix-it that recommends to use a default value. 35 | } 36 | } 37 | 38 | @Row { 39 | @Column { 40 | You can also add mutliple `ExtractCaseValue` macros. 41 | ![Screenshot of Xcode showing the marco expansion on a Coordinate enum which uses multiple macros](sample-three) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Sources/ExtractCaseValue/Documentation.docc/Resources/fix-it@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/Sources/ExtractCaseValue/Documentation.docc/Resources/fix-it@2x.png -------------------------------------------------------------------------------- /Sources/ExtractCaseValue/Documentation.docc/Resources/fix-it~dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/Sources/ExtractCaseValue/Documentation.docc/Resources/fix-it~dark@2x.png -------------------------------------------------------------------------------- /Sources/ExtractCaseValue/Documentation.docc/Resources/sample-one@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/Sources/ExtractCaseValue/Documentation.docc/Resources/sample-one@2x.png -------------------------------------------------------------------------------- /Sources/ExtractCaseValue/Documentation.docc/Resources/sample-one~dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/Sources/ExtractCaseValue/Documentation.docc/Resources/sample-one~dark@2x.png -------------------------------------------------------------------------------- /Sources/ExtractCaseValue/Documentation.docc/Resources/sample-three@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/Sources/ExtractCaseValue/Documentation.docc/Resources/sample-three@2x.png -------------------------------------------------------------------------------- /Sources/ExtractCaseValue/Documentation.docc/Resources/sample-three~dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/Sources/ExtractCaseValue/Documentation.docc/Resources/sample-three~dark@2x.png -------------------------------------------------------------------------------- /Sources/ExtractCaseValue/Documentation.docc/Resources/sample-two@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/Sources/ExtractCaseValue/Documentation.docc/Resources/sample-two@2x.png -------------------------------------------------------------------------------- /Sources/ExtractCaseValue/Documentation.docc/Resources/sample-two~dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/Sources/ExtractCaseValue/Documentation.docc/Resources/sample-two~dark@2x.png -------------------------------------------------------------------------------- /Sources/ExtractCaseValue/ExtractCaseValue.swift: -------------------------------------------------------------------------------- 1 | import ExtractCaseValueMacros 2 | 3 | /// A macro that extracts an associated value from enum cases using a default value if 4 | /// extraction is not possible. 5 | /// 6 | /// For example 7 | /// 8 | /// ```swift 9 | /// @ExtractCaseValue(name: "path", kind: CaseExtractionKind.position(0), defaultValue: "") 10 | /// enum Path { 11 | /// case relative(String) 12 | /// case absolute(String) 13 | /// case root 14 | /// } 15 | /// ``` 16 | /// produces 17 | /// 18 | /// ```swift 19 | /// enum Path { 20 | /// case relative(String) 21 | /// case absolute(String) 22 | /// case root 23 | /// var path: String { 24 | /// switch self { 25 | /// case let .relative(__macro_local_4pathfMu_): 26 | /// return __macro_local_4pathfMu_ 27 | /// case let .absolute(__macro_local_4pathfMu0_): 28 | /// return __macro_local_4pathfMu0_ 29 | /// case .root: 30 | /// return "" 31 | /// } 32 | /// } 33 | /// } 34 | /// ``` 35 | @attached(member, names: arbitrary) 36 | public macro ExtractCaseValue(name: String, kind: CaseExtractionKind = .default, defaultValue: T) = #externalMacro(module: "ExtractCaseValueMacros", type: "ExtractCaseValueMacro") 37 | 38 | /// A macro that extracts an associated value from enum cases. 39 | /// 40 | /// For example 41 | /// 42 | /// ```swift 43 | /// @ExtractCaseValue(name: "path", kind: CaseExtractionKind.position(0)) 44 | /// enum Path { 45 | /// case relative(String) 46 | /// case absolute(String) 47 | /// } 48 | /// ``` 49 | /// produces 50 | /// 51 | /// ```swift 52 | /// enum Path { 53 | /// case relative(String) 54 | /// case absolute(String) 55 | /// case root 56 | /// var path: String { 57 | /// switch self { 58 | /// case let .relative(__macro_local_4pathfMu_): 59 | /// return __macro_local_4pathfMu_ 60 | /// case let .absolute(__macro_local_4pathfMu0_): 61 | /// return __macro_local_4pathfMu0_ 62 | /// } 63 | /// } 64 | /// } 65 | /// ``` 66 | @attached(member, names: arbitrary) 67 | public macro ExtractCaseValue(name: String, kind: CaseExtractionKind = .default) = #externalMacro(module: "ExtractCaseValueMacros", type: "ExtractCaseValueMacro") 68 | -------------------------------------------------------------------------------- /Sources/ExtractCaseValueClient/main.swift: -------------------------------------------------------------------------------- 1 | import ExtractCaseValue 2 | 3 | @ExtractCaseValue(name: "x", kind: .associatedValueName("x")) 4 | @ExtractCaseValue(name: "y", kind: .associatedValueName("y")) 5 | @ExtractCaseValue(name: "z", kind: .associatedValueName("z"), defaultValue: nil) 6 | enum Coordinate { 7 | case twoDee(x: Double, y: Double) 8 | case threeDee(x: Double, y: Double, z: Double) 9 | } 10 | 11 | @ExtractCaseValue(name: "string", kind: .firstMatchingType) 12 | enum JSON { 13 | case string(String) 14 | case number(Double) 15 | case object([String: JSON]) 16 | case array([JSON]) 17 | case bool(Bool) 18 | case null 19 | } 20 | 21 | @ExtractCaseValue(name: "path") 22 | enum Path { 23 | case absolute(String) 24 | case relative(String) 25 | } 26 | -------------------------------------------------------------------------------- /Sources/ExtractCaseValueMacros/CaseExtractionKind.swift: -------------------------------------------------------------------------------- 1 | import SwiftSyntax 2 | 3 | /// The available kinds of case value extractions. 4 | public enum CaseExtractionKind { 5 | /// Extract a value at a position in the associated values. 6 | case position(Int) 7 | 8 | /// Extract a value with a certain name. 9 | case associatedValueName(String) 10 | 11 | /// Extract the first value with a matching type. 12 | case firstMatchingType 13 | 14 | public static let `default` = Self.firstMatchingType 15 | } 16 | 17 | extension CaseExtractionKind { 18 | init?(expr: ExprSyntax) { 19 | guard 20 | let functionCall = expr.as(FunctionCallExprSyntax.self), 21 | let memberAccessExpr = functionCall.calledExpression.as(MemberAccessExprSyntax.self) 22 | else { return nil } 23 | 24 | let firstIntArgument = (functionCall.argumentList.first?.expression.as(IntegerLiteralExprSyntax.self)?.digits.text).flatMap(Int.init) 25 | let firstStringArgument = functionCall.argumentList.first?.expression.stringLiteralSegment 26 | 27 | switch memberAccessExpr.name.text { 28 | case "position" : 29 | guard let position = firstIntArgument else { return nil } 30 | self = .position(position) 31 | case "associatedValueName": 32 | guard let name = firstStringArgument?.content.text else { return nil } 33 | self = .associatedValueName(name) 34 | case "firstMatchingType": 35 | self = .firstMatchingType 36 | default: 37 | return nil 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/ExtractCaseValueMacros/Diagnostics.swift: -------------------------------------------------------------------------------- 1 | import SwiftDiagnostics 2 | import SwiftSyntax 3 | import SwiftSyntaxMacros 4 | 5 | enum ExtractCaseValueMacroDiagnostic { 6 | case requiresEnum 7 | case requiresArgs 8 | case requiresPropertyNameArg 9 | case requiresPropertyNameStringLiteral 10 | case requiresGenericType 11 | case noValue(case: String, index: Int) 12 | case noMatchingType(type: String, case: String) 13 | case noAssociatedValues(case: String) 14 | case noAssociatedValueForName(name: String, case: String) 15 | case typeMismatch(case: String, index: Int) 16 | case typeMismatchNamed(name: String, case: String) 17 | } 18 | 19 | extension ExtractCaseValueMacroDiagnostic: DiagnosticMessage { 20 | func diagnose(at node: some SyntaxProtocol, fixIts: [FixIt] = []) -> Diagnostic { 21 | Diagnostic(node: Syntax(node), message: self, fixIts: fixIts) 22 | } 23 | 24 | var message: String { 25 | switch self { 26 | case .requiresEnum: 27 | return "'ExtractCaseValue' macro can only be applied to an enum" 28 | 29 | case .requiresArgs: 30 | return "'ExtractCaseValue' macro requires arguments" 31 | 32 | case .requiresPropertyNameArg: 33 | return "'ExtractCaseValue' macro requires `\(caseParamExtractionPropertyNameArgumentLabel)` argument" 34 | 35 | case .requiresPropertyNameStringLiteral: 36 | return "'ExtractCaseValue' macro argument `\(caseParamExtractionPropertyNameArgumentLabel)` must be a string literal" 37 | 38 | case .requiresGenericType: 39 | return "'ExtractCaseValue' macro requires a generic type for the computed property" 40 | 41 | case let .noValue(caseName, index): 42 | return "'ExtractCaseValue' macro could not find an associated value for `\(caseName)` at index \(index). Consider using a default value." 43 | 44 | case let .noMatchingType(type, caseName): 45 | return "'ExtractCaseValue' macro found no associated value of type \(type) in `\(caseName)`. Consider using a default value." 46 | 47 | case let .noAssociatedValues(caseName): 48 | return "'ExtractCaseValue' macro could not find associated values for `\(caseName)`. Consider using a default value." 49 | 50 | case let .noAssociatedValueForName(name, caseName): 51 | return "'ExtractCaseValue' macro found no associated value named \(name) in `\(caseName)`. Consider using a default value." 52 | 53 | case let .typeMismatch(caseName, index): 54 | return "'ExtractCaseValue' macro found a mismatching type for `\(caseName)` at index \(index)" 55 | 56 | case let .typeMismatchNamed(paramName, caseName): 57 | return "'ExtractCaseValue' macro found a mismatching type for \(paramName) in the `\(caseName)` case" 58 | } 59 | } 60 | 61 | var severity: DiagnosticSeverity { .error } 62 | 63 | var diagnosticID: MessageID { 64 | MessageID(domain: "Swift", id: "ExtractCaseValue.\(self)") 65 | } 66 | } 67 | 68 | struct InsertDefaultValueItMessage: FixItMessage { 69 | var message: String { 70 | "Insert default value" 71 | } 72 | 73 | var fixItID: MessageID { 74 | MessageID(domain: "Swift", id: "ExtractCaseValue.\(self)") 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Sources/ExtractCaseValueMacros/ExtractCaseValueMacro.swift: -------------------------------------------------------------------------------- 1 | import SwiftDiagnostics 2 | import SwiftSyntax 3 | import SwiftSyntaxBuilder 4 | import SwiftSyntaxMacros 5 | 6 | // Argument labels 7 | let caseParamExtractionPropertyNameArgumentLabel = "name" 8 | let caseParamExtractionKindArgumentLabel = "kind" 9 | let caseParamExtractionTypeArgumentLabel = "type" 10 | let caseParamExtractionDefaultValueArgumentLabel = "defaultValue" 11 | 12 | // default values 13 | let defaultExtractionKind = CaseExtractionKind.default 14 | 15 | public struct ExtractCaseValueMacro {} 16 | 17 | extension ExtractCaseValueMacro: MemberMacro { 18 | public static func expansion( 19 | of attribute: AttributeSyntax, 20 | providingMembersOf declaration: some DeclGroupSyntax, // Declaration is the enum Type 21 | in context: some MacroExpansionContext 22 | ) throws -> [DeclSyntax] { 23 | // Only apply to enums 24 | guard let enumDecl = declaration.as(EnumDeclSyntax.self) else { 25 | context.diagnose(ExtractCaseValueMacroDiagnostic.requiresEnum.diagnose(at: declaration)) 26 | return [] 27 | } 28 | 29 | guard 30 | let arguments = attribute.argument, 31 | case let .argumentList(arguments) = arguments 32 | else { 33 | context.diagnose(ExtractCaseValueMacroDiagnostic.requiresArgs.diagnose(at: attribute)) 34 | return [] 35 | } 36 | 37 | // get `name` argument 38 | guard let propertyNameArg = arguments.first(labeled: caseParamExtractionPropertyNameArgumentLabel) else { 39 | context.diagnose(ExtractCaseValueMacroDiagnostic.requiresPropertyNameArg.diagnose(at: attribute)) 40 | return [] 41 | } 42 | 43 | guard let propertyNameString = propertyNameArg.expression.stringLiteralSegment else { 44 | context.diagnose(ExtractCaseValueMacroDiagnostic.requiresPropertyNameStringLiteral.diagnose(at: propertyNameArg.expression)) 45 | return [] 46 | } 47 | 48 | // get kind argument or use default 49 | let caseExtractionKind: CaseExtractionKind 50 | if 51 | let caseExtractionKindArg = arguments.first(labeled: caseParamExtractionKindArgumentLabel), 52 | let parsedExtractionKind = CaseExtractionKind(expr: caseExtractionKindArg.expression) 53 | { 54 | caseExtractionKind = parsedExtractionKind 55 | } else { 56 | caseExtractionKind = defaultExtractionKind 57 | } 58 | 59 | // get expected type 60 | guard 61 | let returnType = attribute 62 | .attributeName.as(SimpleTypeIdentifierSyntax.self)? 63 | .genericArgumentClause? 64 | .arguments.first? 65 | .argumentType 66 | else { 67 | context.diagnose(ExtractCaseValueMacroDiagnostic.requiresGenericType.diagnose(at: attribute)) 68 | return [] 69 | } 70 | 71 | // get default value 72 | let returnTypeIsOptional = returnType.is(OptionalTypeSyntax.self) 73 | let defaultValue: ExprSyntax? 74 | 75 | if 76 | let defaultValueArg = arguments.first(labeled: caseParamExtractionDefaultValueArgumentLabel) { 77 | defaultValue = defaultValueArg.expression 78 | } else if returnTypeIsOptional { 79 | defaultValue = ExprSyntax("nil") 80 | } else { 81 | defaultValue = nil 82 | } 83 | 84 | // create fix-it to add a default value if necessary 85 | guard 86 | let tupleList = attribute.argument?.as(TupleExprElementListSyntax.self) 87 | else { return [] } 88 | let expr: ExprSyntax = ", \(propertyNameString): <#Type#>" 89 | let newTupleList = tupleList.inserting(TupleExprElementSyntax(expression: expr), at: tupleList.count) 90 | 91 | let insertDefaultFixIt = FixIt( 92 | message: InsertDefaultValueItMessage(), 93 | changes: [.replace(oldNode: Syntax(tupleList), newNode: Syntax(newTupleList))] 94 | ) 95 | 96 | let members = declaration.memberBlock.members 97 | let caseDecls = members.compactMap { $0.decl.as(EnumCaseDeclSyntax.self) } 98 | let elements = caseDecls.flatMap(\.elements) 99 | 100 | // infer access modifier from enum 101 | let access = enumDecl.modifiers?.first(where: \.isNeededAccessLevelModifier) 102 | 103 | var switchCaseSyntaxes: [SwitchCaseSyntax] = [] 104 | 105 | for element in elements { 106 | let caseSyntax = element.as(EnumCaseElementSyntax.self)! 107 | 108 | guard let paramList = caseSyntax.associatedValue?.parameterList else { 109 | if let defaultValue { 110 | switchCaseSyntaxes.append( 111 | "case .\(element.identifier): return \(defaultValue)" 112 | ) 113 | continue 114 | } else { 115 | context.diagnose(ExtractCaseValueMacroDiagnostic.noAssociatedValues(case: element.identifier.text).diagnose(at: element, fixIts: [insertDefaultFixIt])) 116 | return [] 117 | } 118 | } 119 | 120 | let associatedValuesCount = paramList.count 121 | var leadingUnderscoreCount = 0 122 | var didUseDefaultValue = false 123 | 124 | switch caseExtractionKind { 125 | case let .position(index): 126 | guard let associatedValue = paramList.enumerated().first(where: { $0.offset == index }) 127 | else { 128 | if let defaultValue { 129 | switchCaseSyntaxes.append( 130 | "case .\(element.identifier): return \(defaultValue)" 131 | ) 132 | didUseDefaultValue = true 133 | break 134 | } else { 135 | context.diagnose(ExtractCaseValueMacroDiagnostic.noValue(case: element.identifier.text, index: index).diagnose(at: element, fixIts: [insertDefaultFixIt])) 136 | return [] 137 | } 138 | } 139 | 140 | guard associatedValue.element.type.matchesReturnType(returnType) else { 141 | context.diagnose(ExtractCaseValueMacroDiagnostic.typeMismatch(case: element.identifier.text, index: index).diagnose(at: associatedValue.element)) 142 | return [] 143 | } 144 | 145 | leadingUnderscoreCount = index 146 | 147 | case let .associatedValueName(name): 148 | guard let associatedValue = paramList.first(labeled: name), let index = paramList.firstIndex(of: name) else { 149 | if let defaultValue { 150 | switchCaseSyntaxes.append( 151 | "case .\(element.identifier): return \(defaultValue)" 152 | ) 153 | didUseDefaultValue = true 154 | break 155 | } else { 156 | context.diagnose(ExtractCaseValueMacroDiagnostic.noAssociatedValueForName(name: name, case: element.identifier.text).diagnose(at: element, fixIts: [insertDefaultFixIt])) 157 | return [] 158 | } 159 | } 160 | 161 | guard associatedValue.type.matchesReturnType(returnType) else { 162 | context.diagnose(ExtractCaseValueMacroDiagnostic.typeMismatchNamed(name: name, case: element.identifier.text).diagnose(at: associatedValue)) 163 | return [] 164 | } 165 | 166 | leadingUnderscoreCount = index 167 | 168 | case .firstMatchingType: 169 | guard let index = paramList.enumerated().first(where: { $0.element.type.matchesReturnType(returnType) })?.offset 170 | else { 171 | if let defaultValue { 172 | switchCaseSyntaxes.append( 173 | "case .\(element.identifier): return \(defaultValue)" 174 | ) 175 | didUseDefaultValue = true 176 | break 177 | } else { 178 | context.diagnose(ExtractCaseValueMacroDiagnostic.noMatchingType(type: "\(returnType)", case: element.identifier.text).diagnose(at: element, fixIts: [insertDefaultFixIt])) 179 | return [] 180 | } 181 | } 182 | 183 | leadingUnderscoreCount = index 184 | } 185 | 186 | if !didUseDefaultValue { 187 | let trailingUndescoreCount = associatedValuesCount - leadingUnderscoreCount - 1 188 | let uniqueVariableName = context.makeUniqueName(propertyNameString.content.text) 189 | let variablesAndUnderscores = (Array(repeating: "_", count: leadingUnderscoreCount) 190 | + ["\(uniqueVariableName)"] 191 | + Array(repeating: "_", count: trailingUndescoreCount)) 192 | .joined(separator: ", ") 193 | 194 | switchCaseSyntaxes.append( 195 | "case let .\(element.identifier)(\(raw: variablesAndUnderscores)): return \(uniqueVariableName)" 196 | ) 197 | } 198 | 199 | didUseDefaultValue = false 200 | } 201 | 202 | let computedProperty = try VariableDeclSyntax("\(access)var \(propertyNameString): \(returnType)") { 203 | try SwitchExprSyntax("switch self") { 204 | for switchCaseSyntax in switchCaseSyntaxes { 205 | "\(raw: switchCaseSyntax)" 206 | } 207 | } 208 | } 209 | 210 | return [DeclSyntax(computedProperty)] 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /Sources/ExtractCaseValueMacros/Plugin.swift: -------------------------------------------------------------------------------- 1 | import SwiftCompilerPlugin 2 | import SwiftSyntaxMacros 3 | 4 | @main 5 | struct ExtractCaseValuePlugin: CompilerPlugin { 6 | let providingMacros: [Macro.Type] = [ 7 | ExtractCaseValueMacro.self 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /Sources/ExtractCaseValueMacros/SwiftSyntax+Extensions.swift: -------------------------------------------------------------------------------- 1 | import SwiftCompilerPlugin 2 | import SwiftSyntax 3 | import SwiftSyntaxBuilder 4 | import SwiftSyntaxMacros 5 | 6 | extension SyntaxStringInterpolation { 7 | mutating func appendInterpolation(_ node: Node?) { 8 | if let node { 9 | self.appendInterpolation(node) 10 | } 11 | } 12 | } 13 | 14 | extension TypeSyntax { 15 | func matchesReturnType(_ type: TypeSyntax) -> Bool { 16 | guard let typeName = self.as(SimpleTypeIdentifierSyntax.self)?.name.text else { return false } 17 | 18 | return typeName == type.as(SimpleTypeIdentifierSyntax.self)?.name.text || 19 | typeName == type.as(OptionalTypeSyntax.self)?.wrappedType.as(SimpleTypeIdentifierSyntax.self)!.name.text 20 | } 21 | } 22 | 23 | extension DeclModifierSyntax { 24 | var isNeededAccessLevelModifier: Bool { 25 | switch self.name.tokenKind { 26 | case .keyword(.public): return true 27 | default: return false 28 | } 29 | } 30 | } 31 | 32 | extension TupleExprElementListSyntax { 33 | /// Retrieve the first element with the given label. 34 | func first(labeled name: String) -> Element? { 35 | return first { element in 36 | if let label = element.label, label.text == name { 37 | return true 38 | } 39 | 40 | return false 41 | } 42 | } 43 | } 44 | 45 | extension EnumCaseParameterListSyntax { 46 | /// Retrieve the first element with the given label. 47 | func first(labeled name: String) -> Element? { 48 | first { $0.isLabeled(name) } 49 | } 50 | 51 | func firstIndex(of label: String) -> Int? { 52 | enumerated().first(where: { $0.element.isLabeled(label) })?.offset 53 | } 54 | } 55 | 56 | extension EnumCaseParameterListSyntax.Element { 57 | func isLabeled(_ label: String) -> Bool { 58 | self.firstName?.text == label || 59 | (self.firstName?.tokenKind == .wildcard && self.secondName?.text == label) 60 | } 61 | } 62 | 63 | extension ExprSyntax { 64 | var stringLiteralSegment: StringSegmentSyntax? { 65 | guard 66 | let stringLiteral = self.as(StringLiteralExprSyntax.self), 67 | stringLiteral.segments.count == 1, 68 | case let .stringSegment(string)? = stringLiteral.segments.first 69 | else { return nil } 70 | 71 | return string 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/.nojekyll -------------------------------------------------------------------------------- /docs/css/chunk-2f6c85d7.a2bfd365.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */[data-v-57dbbfd9] .code-listing{background:var(--background,var(--color-code-background));color:var(--text,var(--color-code-plain));border-color:var(--colors-grid,var(--color-grid));border-width:var(--code-border-width,1px);border-style:var(--code-border-style,solid)}[data-v-57dbbfd9] .code-listing pre{padding:var(--code-block-style-elements-padding);padding-right:0}[data-v-57dbbfd9] .code-listing pre>code{font-size:.88235rem;line-height:1.66667;font-weight:400;font-family:var(--typography-html-font-mono,Menlo,monospace)}[data-v-57dbbfd9] *+.code-listing,[data-v-57dbbfd9] *+.endpoint-example,[data-v-57dbbfd9] *+.inline-image-container,[data-v-57dbbfd9] *+aside,[data-v-57dbbfd9] *+figure,[data-v-57dbbfd9] .code-listing+*,[data-v-57dbbfd9] .endpoint-example+*,[data-v-57dbbfd9] .inline-image-container+*,[data-v-57dbbfd9] aside+*,[data-v-57dbbfd9] figure+*{margin-top:var(--spacing-stacked-margin-xlarge)}[data-v-57dbbfd9] *+dl,[data-v-57dbbfd9] dl+*{margin-top:var(--spacing-stacked-margin-large)}[data-v-57dbbfd9] img{display:block;margin:auto;max-width:100%}[data-v-57dbbfd9] ol,[data-v-57dbbfd9] ol li:not(:first-child),[data-v-57dbbfd9] ul,[data-v-57dbbfd9] ul li:not(:first-child){margin-top:var(--spacing-stacked-margin-large)}@media only screen and (max-width:735px){[data-v-57dbbfd9] ol,[data-v-57dbbfd9] ul{margin-left:1.25rem}}[data-v-57dbbfd9] dt:not(:first-child){margin-top:var(--spacing-stacked-margin-large)}[data-v-57dbbfd9] dd{margin-left:2em}.badge[data-v-8d6893ae]{--badge-color:var(--color-badge-default);--badge-dark-color:var(--color-badge-dark-default);font-size:.70588rem;line-height:1.33333;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);display:inline-block;padding:2px 10px;white-space:nowrap;background:none;border-radius:var(--badge-border-radius,calc(var(--border-radius, 4px) - 1px));border-style:var(--badge-border-style,solid);border-width:var(--badge-border-width,1px);margin-left:10px;color:var(--badge-color)}.theme-dark .badge[data-v-8d6893ae]{--badge-color:var(--badge-dark-color)}.badge-deprecated[data-v-8d6893ae]{--badge-color:var(--color-badge-deprecated);--badge-dark-color:var(--color-badge-dark-deprecated)}.badge-beta[data-v-8d6893ae]{--badge-color:var(--color-badge-beta);--badge-dark-color:var(--color-badge-dark-beta)}.topic-icon-wrapper[data-v-03cf3183]{display:flex;align-items:center;justify-content:center;height:1.47059rem;flex:0 0 1.294rem;width:1.294rem;margin-right:1rem}.topic-icon[data-v-03cf3183]{height:.88235rem;transform:scale(1);-webkit-transform:scale(1);overflow:visible}.topic-icon[data-v-03cf3183] img{margin:0;display:block;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.topic-icon.curly-brackets-icon[data-v-03cf3183]{height:1rem}.token-method[data-v-5caf1b5b]{font-weight:700}.token-keyword[data-v-5caf1b5b]{color:var(--syntax-keyword,var(--color-syntax-keywords))}.token-number[data-v-5caf1b5b]{color:var(--syntax-number,var(--color-syntax-numbers))}.token-string[data-v-5caf1b5b]{color:var(--syntax-string,var(--color-syntax-strings))}.token-attribute[data-v-5caf1b5b]{color:var(--syntax-attribute,var(--color-syntax-keywords))}.token-internalParam[data-v-5caf1b5b]{color:var(--color-syntax-param-internal-name)}.type-identifier-link[data-v-5caf1b5b]{color:var(--syntax-type,var(--color-syntax-other-type-names))}.token-removed[data-v-5caf1b5b]{background-color:var(--color-highlight-red)}.token-added[data-v-5caf1b5b]{background-color:var(--color-highlight-green)}.decorator[data-v-06ec7395],.label[data-v-06ec7395]{color:var(--colors-secondary-label,var(--color-secondary-label))}.label[data-v-06ec7395]{font-size:1rem;line-height:1.47059;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif)}.empty-token[data-v-06ec7395]{font-size:0}.empty-token[data-v-06ec7395]:after{content:"\00a0";font-size:1rem}.conditional-constraints[data-v-1548fd90] code{color:var(--colors-secondary-label,var(--color-secondary-label))}.abstract[data-v-78eb2e68],.link-block[data-v-78eb2e68] .badge{margin-left:2.294rem}.link-block .badge+.badge[data-v-78eb2e68]{margin-left:1rem}.link[data-v-78eb2e68]{display:flex}.link-block .badge[data-v-78eb2e68]{margin-top:.5rem}.link-block.has-inline-element[data-v-78eb2e68]{display:flex;align-items:flex-start;flex-flow:row wrap}.link-block.has-inline-element .badge[data-v-78eb2e68]{margin-left:1rem;margin-top:0}.link-block .has-adjacent-elements[data-v-78eb2e68]{padding-top:5px;padding-bottom:5px;display:inline-flex}.link-block[data-v-78eb2e68],.link[data-v-78eb2e68]{box-sizing:inherit}.link-block.changed[data-v-78eb2e68],.link.changed[data-v-78eb2e68]{padding-right:1rem;padding-left:2.17647rem;padding-top:8px;padding-bottom:8px;display:inline-flex;width:100%;box-sizing:border-box}.link-block.changed.changed[data-v-78eb2e68],.link.changed.changed[data-v-78eb2e68]{padding-right:1rem}@media only screen and (max-width:735px){.link-block.changed[data-v-78eb2e68],.link.changed[data-v-78eb2e68]{padding-left:0;padding-right:0}.link-block.changed.changed[data-v-78eb2e68],.link.changed.changed[data-v-78eb2e68]{padding-right:17px;padding-left:2.17647rem}}@media only screen and (max-width:735px){.link-block.changed[data-v-78eb2e68],.link.changed[data-v-78eb2e68]{padding-left:0;padding-right:0}}.abstract .topic-required[data-v-78eb2e68]:not(:first-child){margin-top:4px}.topic-required[data-v-78eb2e68]{font-size:.8em}.deprecated[data-v-78eb2e68]{text-decoration:line-through}.conditional-constraints[data-v-78eb2e68]{font-size:.82353rem;margin-top:4px} -------------------------------------------------------------------------------- /docs/css/documentation-topic~topic.b6287bcf.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */.generic-modal[data-v-795f7b59]{position:fixed;top:0;left:0;right:0;bottom:0;margin:0;z-index:11000;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;background:none;overflow:auto}.modal-fullscreen[data-v-795f7b59]{align-items:stretch}.modal-fullscreen .container[data-v-795f7b59]{margin:0;flex:1;width:100%;height:100%;padding-top:env(safe-area-inset-top);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left)}.modal-standard[data-v-795f7b59]{padding:20px}.modal-standard .container[data-v-795f7b59]{padding:60px;border-radius:var(--border-radius,4px)}@media screen{[data-color-scheme=dark] .modal-standard .container[data-v-795f7b59]{background:#1d1d1f}}@media screen and (prefers-color-scheme:dark){[data-color-scheme=auto] .modal-standard .container[data-v-795f7b59]{background:#1d1d1f}}@media only screen and (max-width:735px){.modal-standard[data-v-795f7b59]{padding:0;align-items:stretch}.modal-standard .container[data-v-795f7b59]{margin:20px 0 0;padding:50px 30px;flex:1;width:100%;border-bottom-left-radius:0;border-bottom-right-radius:0}}.backdrop[data-v-795f7b59]{overflow:auto;background:var(--backdrop-background,rgba(0,0,0,.4));-webkit-overflow-scrolling:touch;width:100%;height:100%;position:fixed}.container[data-v-795f7b59]{margin-left:auto;margin-right:auto;width:980px;background:var(--colors-generic-modal-background,var(--color-generic-modal-background));z-index:1;position:relative;overflow:auto;max-width:100%}@media only screen and (max-width:1250px){.container[data-v-795f7b59]{width:692px}}@media only screen and (max-width:735px){.container[data-v-795f7b59]{width:87.5%}}@media only screen and (max-width:320px){.container[data-v-795f7b59]{width:215px}}.close[data-v-795f7b59]{position:absolute;z-index:9999;top:22px;left:22px;width:17px;height:17px;color:#666;cursor:pointer;background:none;border:0;display:flex;align-items:center}.close .close-icon[data-v-795f7b59]{fill:currentColor;width:100%;height:100%}.theme-dark .container[data-v-795f7b59]{background:#000}.theme-dark .container .close[data-v-795f7b59]{color:#b0b0b0}.theme-code .container[data-v-795f7b59]{background-color:var(--code-background,var(--color-code-background))} -------------------------------------------------------------------------------- /docs/data/documentation/extractcasevalue.json: -------------------------------------------------------------------------------- 1 | {"variants":[{"paths":["\/documentation\/extractcasevalue"],"traits":[{"interfaceLanguage":"swift"}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"identifier":{"url":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue","interfaceLanguage":"swift"},"topicSections":[{"title":"Articles","identifiers":["doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/Documentation"],"generated":true},{"title":"Macros","identifiers":["doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/ExtractCaseValue(name:kind:)","doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/ExtractCaseValue(name:kind:defaultValue:)"]}],"kind":"symbol","metadata":{"roleHeading":"Framework","externalID":"ExtractCaseValue","title":"ExtractCaseValue","symbolKind":"module","role":"collection","modules":[{"name":"ExtractCaseValue"}]},"hierarchy":{"paths":[[]]},"references":{"doc://ExtractCaseValue/documentation/ExtractCaseValue":{"role":"collection","title":"ExtractCaseValue","abstract":[],"identifier":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue","kind":"symbol","type":"topic","url":"\/documentation\/extractcasevalue"},"doc://ExtractCaseValue/documentation/ExtractCaseValue/Documentation":{"role":"article","title":"ExtractCaseValue","abstract":[{"type":"text","text":"The "},{"type":"codeVoice","code":"ExtractCaseValue"},{"type":"text","text":" package provides a macro to expose assiocated values from enum cases as a computed property."}],"identifier":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/Documentation","kind":"article","type":"topic","url":"\/documentation\/extractcasevalue\/documentation"},"doc://ExtractCaseValue/documentation/ExtractCaseValue/ExtractCaseValue(name:kind:defaultValue:)":{"role":"symbol","title":"ExtractCaseValue(name:kind:defaultValue:)","fragments":[{"kind":"keyword","text":"macro"},{"kind":"text","text":" "},{"kind":"identifier","text":"ExtractCaseValue"},{"kind":"text","text":"<"},{"kind":"genericParameter","text":"T"},{"kind":"text","text":">("},{"kind":"externalParam","text":"name"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":", "},{"kind":"externalParam","text":"kind"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CaseExtractionKind","preciseIdentifier":"s:22ExtractCaseValueMacros0B14ExtractionKindO"},{"kind":"text","text":", "},{"kind":"externalParam","text":"defaultValue"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"T"},{"kind":"text","text":") -> ()"}],"abstract":[{"type":"text","text":"A macro that extracts an associated value from enum cases using a default value if"},{"type":"text","text":" "},{"type":"text","text":"extraction is not possible."}],"identifier":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/ExtractCaseValue(name:kind:defaultValue:)","kind":"symbol","type":"topic","url":"\/documentation\/extractcasevalue\/extractcasevalue(name:kind:defaultvalue:)"},"doc://ExtractCaseValue/documentation/ExtractCaseValue/ExtractCaseValue(name:kind:)":{"role":"symbol","title":"ExtractCaseValue(name:kind:)","fragments":[{"kind":"keyword","text":"macro"},{"kind":"text","text":" "},{"kind":"identifier","text":"ExtractCaseValue"},{"kind":"text","text":"<"},{"kind":"genericParameter","text":"T"},{"kind":"text","text":">("},{"kind":"externalParam","text":"name"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":", "},{"kind":"externalParam","text":"kind"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CaseExtractionKind","preciseIdentifier":"s:22ExtractCaseValueMacros0B14ExtractionKindO"},{"kind":"text","text":") -> ()"}],"abstract":[{"type":"text","text":"A macro that extracts an associated value from enum cases."}],"identifier":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/ExtractCaseValue(name:kind:)","kind":"symbol","type":"topic","url":"\/documentation\/extractcasevalue\/extractcasevalue(name:kind:)"}}} -------------------------------------------------------------------------------- /docs/data/documentation/extractcasevalue/documentation.json: -------------------------------------------------------------------------------- 1 | {"primaryContentSections":[{"kind":"content","content":[{"anchor":"Overview","level":2,"type":"heading","text":"Overview"},{"type":"row","columns":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"To extract a simple value annotate an enum with the "},{"type":"codeVoice","code":"ExtractCaseValue"},{"type":"text","text":" macro and provide the expected type as a generic along with a name for the comuted property. This will use the "},{"type":"codeVoice","code":".firstMatchingType"},{"type":"text","text":" as a default to use the first associated value in a case that matches the expected type (in this case "},{"type":"codeVoice","code":"String"},{"type":"text","text":")."}]}],"size":1},{"content":[{"type":"paragraph","inlineContent":[{"type":"image","identifier":"sample-one"}]}],"size":1}],"numberOfColumns":2},{"type":"row","columns":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"If the return type is optional the macro will infer "},{"type":"codeVoice","code":"nil"},{"type":"text","text":" as the default value."}]}],"size":1},{"content":[{"type":"paragraph","inlineContent":[{"type":"image","identifier":"sample-two"}]}],"size":1}],"numberOfColumns":2},{"type":"row","columns":[{"content":[{"type":"paragraph","inlineContent":[{"type":"image","identifier":"fix-it"}]}],"size":1},{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Otherwise, you will get a fix-it that recommends to use a default value."}]}],"size":1}],"numberOfColumns":2},{"type":"row","columns":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"You can also add mutliple "},{"type":"codeVoice","code":"ExtractCaseValue"},{"type":"text","text":" macros."},{"type":"text","text":" "},{"type":"image","identifier":"sample-three"}]}],"size":1}],"numberOfColumns":1}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/extractcasevalue\/documentation"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/Documentation","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"The "},{"type":"codeVoice","code":"ExtractCaseValue"},{"type":"text","text":" package provides a macro to expose assiocated values from enum cases as a computed property."}],"kind":"article","metadata":{"roleHeading":"Article","color":{"standardColorIdentifier":"blue"},"title":"ExtractCaseValue","role":"article","modules":[{"name":"ExtractCaseValue"}]},"hierarchy":{"paths":[["doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue"]]},"references":{"sample-two":{"alt":"Screenshot of Xcode showing the marco expansion on a JSON enum with an optional String as return type","type":"image","identifier":"sample-two","variants":[{"url":"\/images\/sample-two@2x.png","traits":["2x","light"]},{"url":"\/images\/sample-two~dark@2x.png","traits":["2x","dark"]}]},"sample-three":{"alt":"Screenshot of Xcode showing the marco expansion on a Coordinate enum which uses multiple macros","type":"image","identifier":"sample-three","variants":[{"url":"\/images\/sample-three@2x.png","traits":["2x","light"]},{"url":"\/images\/sample-three~dark@2x.png","traits":["2x","dark"]}]},"doc://ExtractCaseValue/documentation/ExtractCaseValue":{"role":"collection","title":"ExtractCaseValue","abstract":[],"identifier":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue","kind":"symbol","type":"topic","url":"\/documentation\/extractcasevalue"},"fix-it":{"alt":"Screenshot of Xcode showing the fix-it","type":"image","identifier":"fix-it","variants":[{"url":"\/images\/fix-it@2x.png","traits":["2x","light"]},{"url":"\/images\/fix-it~dark@2x.png","traits":["2x","dark"]}]},"sample-one":{"alt":"Screenshot of Xcode showing the marco expansion on a Path enum with a String as return type","type":"image","identifier":"sample-one","variants":[{"url":"\/images\/sample-one@2x.png","traits":["2x","light"]},{"url":"\/images\/sample-one~dark@2x.png","traits":["2x","dark"]}]}}} -------------------------------------------------------------------------------- /docs/data/documentation/extractcasevalue/extractcasevalue(name:kind:).json: -------------------------------------------------------------------------------- 1 | {"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"attribute","text":"@attached"},{"kind":"text","text":"(member, names: arbitrary) "},{"kind":"keyword","text":"macro"},{"kind":"text","text":" "},{"kind":"identifier","text":"ExtractCaseValue"},{"kind":"text","text":"<"},{"kind":"genericParameter","text":"T"},{"kind":"text","text":">("},{"kind":"externalParam","text":"name"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":", "},{"kind":"externalParam","text":"kind"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CaseExtractionKind","preciseIdentifier":"s:22ExtractCaseValueMacros0B14ExtractionKindO"},{"kind":"text","text":" = .default) -> ()"}],"languages":["swift"],"platforms":["macOS"]}]},{"kind":"content","content":[{"anchor":"overview","level":2,"type":"heading","text":"Overview"},{"type":"paragraph","inlineContent":[{"type":"text","text":"For example"}]},{"type":"codeListing","syntax":"swift","code":["@ExtractCaseValue(name: \"path\", kind: CaseExtractionKind.position(0))","enum Path {"," case relative(String)"," case absolute(String)","}"]},{"type":"paragraph","inlineContent":[{"type":"text","text":"produces"}]},{"type":"codeListing","syntax":"swift","code":["enum Path {"," case relative(String)"," case absolute(String)"," case root"," var path: String {"," switch self {"," case let .relative(__macro_local_4pathfMu_):"," return __macro_local_4pathfMu_"," case let .absolute(__macro_local_4pathfMu0_):"," return __macro_local_4pathfMu0_"," }"," }","}"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/extractcasevalue\/extractcasevalue(name:kind:)"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/ExtractCaseValue(name:kind:)","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"A macro that extracts an associated value from enum cases."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"macro"},{"kind":"text","text":" "},{"kind":"identifier","text":"ExtractCaseValue"},{"kind":"text","text":"<"},{"kind":"genericParameter","text":"T"},{"kind":"text","text":">("},{"kind":"externalParam","text":"name"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":", "},{"kind":"externalParam","text":"kind"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CaseExtractionKind","preciseIdentifier":"s:22ExtractCaseValueMacros0B14ExtractionKindO"},{"kind":"text","text":") -> ()"}],"title":"ExtractCaseValue(name:kind:)","roleHeading":"Macro","role":"symbol","symbolKind":"macro","externalID":"s:16ExtractCaseValueAA4name4kindySS_0abC6Macros0B14ExtractionKindOtclufm","modules":[{"name":"ExtractCaseValue"}]},"hierarchy":{"paths":[["doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue"]]},"references":{"doc://ExtractCaseValue/documentation/ExtractCaseValue/ExtractCaseValue(name:kind:)":{"role":"symbol","title":"ExtractCaseValue(name:kind:)","fragments":[{"kind":"keyword","text":"macro"},{"kind":"text","text":" "},{"kind":"identifier","text":"ExtractCaseValue"},{"kind":"text","text":"<"},{"kind":"genericParameter","text":"T"},{"kind":"text","text":">("},{"kind":"externalParam","text":"name"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":", "},{"kind":"externalParam","text":"kind"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CaseExtractionKind","preciseIdentifier":"s:22ExtractCaseValueMacros0B14ExtractionKindO"},{"kind":"text","text":") -> ()"}],"abstract":[{"type":"text","text":"A macro that extracts an associated value from enum cases."}],"identifier":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/ExtractCaseValue(name:kind:)","kind":"symbol","type":"topic","url":"\/documentation\/extractcasevalue\/extractcasevalue(name:kind:)"},"doc://ExtractCaseValue/documentation/ExtractCaseValue":{"role":"collection","title":"ExtractCaseValue","abstract":[],"identifier":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue","kind":"symbol","type":"topic","url":"\/documentation\/extractcasevalue"}}} -------------------------------------------------------------------------------- /docs/data/documentation/extractcasevalue/extractcasevalue(name:kind:defaultvalue:).json: -------------------------------------------------------------------------------- 1 | {"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"attribute","text":"@attached"},{"kind":"text","text":"(member, names: arbitrary) "},{"kind":"keyword","text":"macro"},{"kind":"text","text":" "},{"kind":"identifier","text":"ExtractCaseValue"},{"kind":"text","text":"<"},{"kind":"genericParameter","text":"T"},{"kind":"text","text":">("},{"kind":"externalParam","text":"name"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":", "},{"kind":"externalParam","text":"kind"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CaseExtractionKind","preciseIdentifier":"s:22ExtractCaseValueMacros0B14ExtractionKindO"},{"kind":"text","text":" = .default, "},{"kind":"externalParam","text":"defaultValue"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"T"},{"kind":"text","text":") -> ()"}],"languages":["swift"],"platforms":["macOS"]}]},{"kind":"content","content":[{"anchor":"overview","level":2,"type":"heading","text":"Overview"},{"type":"paragraph","inlineContent":[{"type":"text","text":"For example"}]},{"type":"codeListing","syntax":"swift","code":["@ExtractCaseValue(name: \"path\", kind: CaseExtractionKind.position(0), defaultValue: \"\")","enum Path {"," case relative(String)"," case absolute(String)"," case root","}"]},{"type":"paragraph","inlineContent":[{"type":"text","text":"produces"}]},{"type":"codeListing","syntax":"swift","code":["enum Path {"," case relative(String)"," case absolute(String)"," case root"," var path: String {"," switch self {"," case let .relative(__macro_local_4pathfMu_):"," return __macro_local_4pathfMu_"," case let .absolute(__macro_local_4pathfMu0_):"," return __macro_local_4pathfMu0_"," case .root:"," return \"\""," }"," }","}"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/extractcasevalue\/extractcasevalue(name:kind:defaultvalue:)"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/ExtractCaseValue(name:kind:defaultValue:)","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"A macro that extracts an associated value from enum cases using a default value if"},{"type":"text","text":" "},{"type":"text","text":"extraction is not possible."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"macro"},{"kind":"text","text":" "},{"kind":"identifier","text":"ExtractCaseValue"},{"kind":"text","text":"<"},{"kind":"genericParameter","text":"T"},{"kind":"text","text":">("},{"kind":"externalParam","text":"name"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":", "},{"kind":"externalParam","text":"kind"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CaseExtractionKind","preciseIdentifier":"s:22ExtractCaseValueMacros0B14ExtractionKindO"},{"kind":"text","text":", "},{"kind":"externalParam","text":"defaultValue"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"T"},{"kind":"text","text":") -> ()"}],"title":"ExtractCaseValue(name:kind:defaultValue:)","roleHeading":"Macro","role":"symbol","symbolKind":"macro","externalID":"s:16ExtractCaseValueAA4name4kind07defaultC0ySS_0abC6Macros0B14ExtractionKindOxtclufm","modules":[{"name":"ExtractCaseValue"}]},"hierarchy":{"paths":[["doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue"]]},"references":{"doc://ExtractCaseValue/documentation/ExtractCaseValue":{"role":"collection","title":"ExtractCaseValue","abstract":[],"identifier":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue","kind":"symbol","type":"topic","url":"\/documentation\/extractcasevalue"},"doc://ExtractCaseValue/documentation/ExtractCaseValue/ExtractCaseValue(name:kind:defaultValue:)":{"role":"symbol","title":"ExtractCaseValue(name:kind:defaultValue:)","fragments":[{"kind":"keyword","text":"macro"},{"kind":"text","text":" "},{"kind":"identifier","text":"ExtractCaseValue"},{"kind":"text","text":"<"},{"kind":"genericParameter","text":"T"},{"kind":"text","text":">("},{"kind":"externalParam","text":"name"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":", "},{"kind":"externalParam","text":"kind"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CaseExtractionKind","preciseIdentifier":"s:22ExtractCaseValueMacros0B14ExtractionKindO"},{"kind":"text","text":", "},{"kind":"externalParam","text":"defaultValue"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"T"},{"kind":"text","text":") -> ()"}],"abstract":[{"type":"text","text":"A macro that extracts an associated value from enum cases using a default value if"},{"type":"text","text":" "},{"type":"text","text":"extraction is not possible."}],"identifier":"doc:\/\/ExtractCaseValue\/documentation\/ExtractCaseValue\/ExtractCaseValue(name:kind:defaultValue:)","kind":"symbol","type":"topic","url":"\/documentation\/extractcasevalue\/extractcasevalue(name:kind:defaultvalue:)"}}} -------------------------------------------------------------------------------- /docs/developer-og-twitter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/developer-og-twitter.jpg -------------------------------------------------------------------------------- /docs/developer-og.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/developer-og.jpg -------------------------------------------------------------------------------- /docs/documentation/extractcasevalue/documentation/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/extractcasevalue/extractcasevalue(name:kind:)/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/extractcasevalue/extractcasevalue(name:kind:defaultvalue:)/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/extractcasevalue/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/favicon.ico -------------------------------------------------------------------------------- /docs/favicon.svg: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /docs/images/fix-it@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/images/fix-it@2x.png -------------------------------------------------------------------------------- /docs/images/fix-it~dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/images/fix-it~dark@2x.png -------------------------------------------------------------------------------- /docs/images/sample-one@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/images/sample-one@2x.png -------------------------------------------------------------------------------- /docs/images/sample-one~dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/images/sample-one~dark@2x.png -------------------------------------------------------------------------------- /docs/images/sample-three@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/images/sample-three@2x.png -------------------------------------------------------------------------------- /docs/images/sample-three~dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/images/sample-three~dark@2x.png -------------------------------------------------------------------------------- /docs/images/sample-two@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/images/sample-two@2x.png -------------------------------------------------------------------------------- /docs/images/sample-two~dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/images/sample-two~dark@2x.png -------------------------------------------------------------------------------- /docs/img/added-icon.d6f7e47d.svg: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /docs/img/deprecated-icon.015b4f17.svg: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /docs/img/modified-icon.f496e73d.svg: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /docs/img/no-image@2x.df2a0a50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fruitcoder/extract-case-value/542c660d65228656e792a871553d4a10a2f740e9/docs/img/no-image@2x.df2a0a50.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/index/index.json: -------------------------------------------------------------------------------- 1 | {"interfaceLanguages":{"swift":[{"children":[{"title":"Articles","type":"groupMarker"},{"path":"\/documentation\/extractcasevalue\/documentation","title":"ExtractCaseValue","type":"article"},{"title":"Macros","type":"groupMarker"},{"path":"\/documentation\/extractcasevalue\/extractcasevalue(name:kind:)","title":"macro ExtractCaseValue(name: String, kind: CaseExtractionKind) -> ()","type":"macro"},{"path":"\/documentation\/extractcasevalue\/extractcasevalue(name:kind:defaultvalue:)","title":"macro ExtractCaseValue(name: String, kind: CaseExtractionKind, defaultValue: T) -> ()","type":"macro"}],"path":"\/documentation\/extractcasevalue","title":"ExtractCaseValue","type":"module"}]},"schemaVersion":{"major":0,"minor":1,"patch":1}} -------------------------------------------------------------------------------- /docs/js/chunk-2d0d3105.cd72cc8e.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d3105"],{"5abe":function(t,e){(function(){"use strict";if("object"===typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var t=function(t){var e=t,n=i(e);while(n)e=n.ownerDocument,n=i(e);return e}(window.document),e=[],n=null,o=null;s.prototype.THROTTLE_TIMEOUT=100,s.prototype.POLL_INTERVAL=null,s.prototype.USE_MUTATION_OBSERVER=!0,s._setupCrossOriginUpdater=function(){return n||(n=function(t,n){o=t&&n?g(t,n):p(),e.forEach((function(t){t._checkForIntersections()}))}),n},s._resetCrossOriginUpdater=function(){n=null,o=null},s.prototype.observe=function(t){var e=this._observationTargets.some((function(e){return e.element==t}));if(!e){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(t.ownerDocument),this._checkForIntersections()}},s.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter((function(e){return e.element!=t})),this._unmonitorIntersections(t.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},s.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},s.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},s.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter((function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]}))},s.prototype._parseRootMargin=function(t){var e=t||"0px",n=e.split(/\s+/).map((function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}}));return n[1]=n[1]||n[0],n[2]=n[2]||n[0],n[3]=n[3]||n[1],n},s.prototype._monitorIntersections=function(e){var n=e.defaultView;if(n&&-1==this._monitoringDocuments.indexOf(e)){var o=this._checkForIntersections,r=null,s=null;this.POLL_INTERVAL?r=n.setInterval(o,this.POLL_INTERVAL):(c(n,"resize",o,!0),c(e,"scroll",o,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in n&&(s=new n.MutationObserver(o),s.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))),this._monitoringDocuments.push(e),this._monitoringUnsubscribes.push((function(){var t=e.defaultView;t&&(r&&t.clearInterval(r),a(t,"resize",o,!0)),a(e,"scroll",o,!0),s&&s.disconnect()}));var h=this.root&&(this.root.ownerDocument||this.root)||t;if(e!=h){var u=i(e);u&&this._monitorIntersections(u.ownerDocument)}}},s.prototype._unmonitorIntersections=function(e){var n=this._monitoringDocuments.indexOf(e);if(-1!=n){var o=this.root&&(this.root.ownerDocument||this.root)||t,r=this._observationTargets.some((function(t){var n=t.element.ownerDocument;if(n==e)return!0;while(n&&n!=o){var r=i(n);if(n=r&&r.ownerDocument,n==e)return!0}return!1}));if(!r){var s=this._monitoringUnsubscribes[n];if(this._monitoringDocuments.splice(n,1),this._monitoringUnsubscribes.splice(n,1),s(),e!=o){var h=i(e);h&&this._unmonitorIntersections(h.ownerDocument)}}}},s.prototype._unmonitorAllIntersections=function(){var t=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var e=0;e=0&&h>=0&&{top:n,bottom:o,left:i,right:r,width:s,height:h}||null}function f(t){var e;try{e=t.getBoundingClientRect()}catch(n){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):p()}function p(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function d(t){return!t||"x"in t?t:{top:t.top,y:t.top,bottom:t.bottom,left:t.left,x:t.left,right:t.right,width:t.width,height:t.height}}function g(t,e){var n=e.top-t.top,o=e.left-t.left;return{top:n,left:o,height:e.height,width:e.width,bottom:n+e.height,right:o+e.width}}function m(t,e){var n=e;while(n){if(n==t)return!0;n=v(n)}return!1}function v(e){var n=e.parentNode;return 9==e.nodeType&&e!=t?i(e):(n&&n.assignedSlot&&(n=n.assignedSlot.parentNode),n&&11==n.nodeType&&n.host?n.host:n)}function w(t){return t&&9===t.nodeType}})()}}]); -------------------------------------------------------------------------------- /docs/js/chunk-2f6c85d7.98346996.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2f6c85d7"],{"00b4":function(e,t,n){"use strict";var a,r,i,o,s,c,l,d,p=n("7b1f"),u={name:"ChangedToken",render(e){const{kind:t,tokens:n}=this;return e("span",{class:["token-"+t,"token-changed"]},n.map(t=>e(D,{props:t})))},props:{kind:{type:String,required:!0},tokens:{type:Array,required:!0}}},f=u,m=n("2877"),h=Object(m["a"])(f,a,r,!1,null,null,null),b=h.exports,g={name:"RawText",render(e){const{_v:t=(t=>e("span",t)),text:n}=this;return t(n)},props:{text:{type:String,required:!0}}},v=g,y=Object(m["a"])(v,i,o,!1,null,null,null),k=y.exports,C={name:"SyntaxToken",render(e){return e("span",{class:"token-"+this.kind},this.text)},props:{kind:{type:String,required:!0},text:{type:String,required:!0}}},_=C,x=Object(m["a"])(_,s,c,!1,null,null,null),O=x.exports,B=n("86d8"),T=n("2f34"),S={name:"TypeIdentifierLink",mixins:[T["a"]],render(e){const t="type-identifier-link",n=this.references[this.identifier];return n&&n.url?e(B["a"],{class:t,props:{url:n.url,kind:n.kind,role:n.role}},this.$slots.default):e("span",{class:t},this.$slots.default)},props:{identifier:{type:String,required:!0,default:()=>""}}},I=S,$=Object(m["a"])(I,l,d,!1,null,null,null),j=$.exports;const q={attribute:"attribute",externalParam:"externalParam",genericParameter:"genericParameter",identifier:"identifier",internalParam:"internalParam",keyword:"keyword",label:"label",number:"number",string:"string",text:"text",typeIdentifier:"typeIdentifier",added:"added",removed:"removed"};var w,A,P={name:"DeclarationToken",render(e){const{kind:t,text:n,tokens:a}=this;switch(t){case q.text:{const t={text:n};return e(k,{props:t})}case q.typeIdentifier:{const t={identifier:this.identifier};return e(j,{props:t},[e(p["a"],n)])}case q.added:case q.removed:return e(b,{props:{tokens:a,kind:t}});default:{const a={kind:t,text:n};return e(O,{props:a})}}},constants:{TokenKind:q},props:{kind:{type:String,required:!0},identifier:{type:String,required:!1},text:{type:String,required:!1},tokens:{type:Array,required:!1,default:()=>[]}}},F=P,z=(n("c36f"),Object(m["a"])(F,w,A,!1,null,"5caf1b5b",null)),D=t["a"]=z.exports},1195:function(e,t,n){},"2a18":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"link-block",class:e.linkBlockClasses},[n(e.linkComponent,e._b({ref:"apiChangesDiff",tag:"component",staticClass:"link",class:e.linkClasses},"component",e.linkProps,!1),[e.topic.role&&!e.change?n("TopicLinkBlockIcon",{attrs:{role:e.topic.role,imageOverride:e.references[e.iconOverride]}}):e._e(),e.topic.fragments?n("DecoratedTopicTitle",{attrs:{tokens:e.topic.fragments}}):n("WordBreak",{attrs:{tag:e.titleTag}},[e._v(e._s(e.topic.title))]),e.change?n("span",{staticClass:"visuallyhidden"},[e._v("- "+e._s(e.$t(e.changeName)))]):e._e()],1),e.hasAbstractElements?n("div",{staticClass:"abstract"},[e.topic.abstract?n("ContentNode",{attrs:{content:e.topic.abstract}}):e._e(),e.topic.ideTitle?n("div",{staticClass:"topic-keyinfo"},[e.topic.titleStyle===e.titleStyles.title?[n("strong",[e._v("Key:")]),e._v(" "+e._s(e.topic.name)+" ")]:e.topic.titleStyle===e.titleStyles.symbol?[n("strong",[e._v("Name:")]),e._v(" "+e._s(e.topic.ideTitle)+" ")]:e._e()],2):e._e(),e.topic.required||e.topic.defaultImplementations?n("RequirementMetadata",{staticClass:"topic-required",attrs:{defaultImplementationsCount:e.topic.defaultImplementations}}):e._e(),e.topic.conformance?n("ConditionalConstraints",{attrs:{constraints:e.topic.conformance.constraints,prefix:e.topic.conformance.availabilityPrefix}}):e._e()],1):e._e(),e.showDeprecatedBadge?n("Badge",{attrs:{variant:"deprecated"}}):e.showBetaBadge?n("Badge",{attrs:{variant:"beta"}}):e._e(),e._l(e.tags,(function(t){return n("Badge",{key:t.type+"-"+t.text,attrs:{variant:t.type}},[e._v(" "+e._s(t.text)+" ")])}))],2)},r=[],i=n("66cd"),o=n("d26a"),s=n("a0fd"),c=n("7b1f"),l=n("6359"),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.imageOverride||e.icon?n("div",{staticClass:"topic-icon-wrapper"},[e.imageOverride?n("OverridableAsset",{staticClass:"topic-icon",attrs:{imageOverride:e.imageOverride}}):e.icon?n(e.icon,{tag:"component",staticClass:"topic-icon"}):e._e()],1):e._e()},p=[],u=n("a9f1"),f=n("3b96"),m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("SVGIcon",{staticClass:"api-reference-icon",attrs:{viewBox:"0 0 14 14",themeId:"api-reference"}},[n("title",[e._v(e._s(e.$t("api-reference")))]),n("path",{attrs:{d:"m1 1v12h12v-12zm11 11h-10v-10h10z"}}),n("path",{attrs:{d:"m3 4h8v1h-8zm0 2.5h8v1h-8zm0 2.5h8v1h-8z"}}),n("path",{attrs:{d:"m3 4h8v1h-8z"}}),n("path",{attrs:{d:"m3 6.5h8v1h-8z"}}),n("path",{attrs:{d:"m3 9h8v1h-8z"}})])},h=[],b=n("be08"),g={name:"APIReferenceIcon",components:{SVGIcon:b["a"]}},v=g,y=n("2877"),k=Object(y["a"])(v,m,h,!1,null,null,null),C=k.exports,_=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("SVGIcon",{attrs:{viewBox:"0 0 14 14",themeId:"endpoint"}},[n("title",[e._v(e._s(e.$t("icons.web-service-endpoint")))]),n("path",{attrs:{d:"M4.052 8.737h-1.242l-1.878 5.263h1.15l0.364-1.081h1.939l0.339 1.081h1.193zM2.746 12.012l0.678-2.071 0.653 2.071z"}}),n("path",{attrs:{d:"M11.969 8.737h1.093v5.263h-1.093v-5.263z"}}),n("path",{attrs:{d:"M9.198 8.737h-2.295v5.263h1.095v-1.892h1.12c0.040 0.003 0.087 0.004 0.134 0.004 0.455 0 0.875-0.146 1.217-0.394l-0.006 0.004c0.296-0.293 0.48-0.699 0.48-1.148 0-0.060-0.003-0.118-0.010-0.176l0.001 0.007c0.003-0.039 0.005-0.085 0.005-0.131 0-0.442-0.183-0.842-0.476-1.128l-0-0c-0.317-0.256-0.724-0.41-1.168-0.41-0.034 0-0.069 0.001-0.102 0.003l0.005-0zM9.628 11.014c-0.15 0.118-0.341 0.188-0.548 0.188-0.020 0-0.040-0.001-0.060-0.002l0.003 0h-1.026v-1.549h1.026c0.017-0.001 0.037-0.002 0.058-0.002 0.206 0 0.396 0.066 0.551 0.178l-0.003-0.002c0.135 0.13 0.219 0.313 0.219 0.515 0 0.025-0.001 0.050-0.004 0.074l0-0.003c0.002 0.020 0.003 0.044 0.003 0.068 0 0.208-0.083 0.396-0.219 0.534l0-0z"}}),n("path",{attrs:{d:"M13.529 4.981c0-1.375-1.114-2.489-2.489-2.49h-0l-0.134 0.005c-0.526-1.466-1.903-2.496-3.522-2.496-0.892 0-1.711 0.313-2.353 0.835l0.007-0.005c-0.312-0.243-0.709-0.389-1.14-0.389-1.030 0-1.865 0.834-1.866 1.864v0c0 0.001 0 0.003 0 0.004 0 0.123 0.012 0.242 0.036 0.358l-0.002-0.012c-0.94 0.37-1.593 1.27-1.593 2.323 0 1.372 1.11 2.485 2.482 2.49h8.243c1.306-0.084 2.333-1.164 2.333-2.484 0-0.001 0-0.002 0-0.003v0zM11.139 6.535h-8.319c-0.799-0.072-1.421-0.739-1.421-1.551 0-0.659 0.41-1.223 0.988-1.45l0.011-0.004 0.734-0.28-0.148-0.776-0.012-0.082v-0.088c0-0 0-0.001 0-0.001 0-0.515 0.418-0.933 0.933-0.933 0.216 0 0.416 0.074 0.574 0.197l-0.002-0.002 0.584 0.453 0.575-0.467 0.169-0.127c0.442-0.306 0.991-0.489 1.581-0.489 1.211 0 2.243 0.769 2.633 1.846l0.006 0.019 0.226 0.642 0.814-0.023 0.131 0.006c0.805 0.067 1.432 0.736 1.432 1.552 0 0.836-0.659 1.518-1.486 1.556l-0.003 0z"}})])},x=[],O={name:"EndpointIcon",components:{SVGIcon:b["a"]}},B=O,T=Object(y["a"])(B,_,x,!1,null,null,null),S=T.exports,I=n("a295"),$=n("3024"),j=n("8d2d"),q=n("fdd9");const w={[i["a"].article]:u["a"],[i["a"].collection]:$["a"],[i["a"].collectionGroup]:C,[i["a"].learn]:I["a"],[i["a"].overview]:I["a"],[i["a"].project]:j["a"],[i["a"].tutorial]:j["a"],[i["a"].resources]:I["a"],[i["a"].sampleCode]:f["a"],[i["a"].restRequestSymbol]:S};var A={components:{OverridableAsset:q["a"],SVGIcon:b["a"]},props:{role:{type:String,required:!0},imageOverride:{type:Object,default:null}},computed:{icon:({role:e})=>w[e]}},P=A,F=(n("d94b"),Object(y["a"])(P,d,p,!1,null,"03cf3183",null)),z=F.exports,D=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("code",{staticClass:"decorated-title"},e._l(e.tokens,(function(t,a){return n(e.componentFor(t),{key:a,tag:"component",class:[e.classFor(t),e.emptyTokenClass(t)]},[e._v(e._s(t.text))])})),1)},N=[],E=n("00b4");const{TokenKind:M}=E["a"].constants,V={decorator:"decorator",identifier:"identifier",label:"label"};var L={name:"DecoratedTopicTitle",components:{WordBreak:c["a"]},props:{tokens:{type:Array,required:!0,default:()=>[]}},constants:{TokenKind:M},methods:{emptyTokenClass:({text:e})=>({"empty-token":" "===e}),classFor({kind:e}){switch(e){case M.externalParam:case M.identifier:return V.identifier;case M.label:return V.label;default:return V.decorator}},componentFor(e){return/^\s+$/.test(e.text)?"span":c["a"]}}},R=L,W=(n("dcf6"),Object(y["a"])(R,D,N,!1,null,"06ec7395",null)),G=W.exports,K=n("64cf"),H=n("e8ea"),J=n("5d59"),X=n("2f34");const Q={article:"article",symbol:"symbol"},U={title:"title",symbol:"symbol"},Y={link:"link"};var Z={name:"TopicsLinkBlock",components:{Badge:s["a"],WordBreak:c["a"],ContentNode:l["a"],TopicLinkBlockIcon:z,DecoratedTopicTitle:G,RequirementMetadata:H["a"],ConditionalConstraints:K["a"]},mixins:[J["b"],J["a"],X["a"]],constants:{ReferenceType:Y,TopicKind:Q,TitleStyles:U},props:{isSymbolBeta:Boolean,isSymbolDeprecated:Boolean,topic:{type:Object,required:!0,validator:e=>(!("abstract"in e)||Array.isArray(e.abstract))&&"string"===typeof e.identifier&&(e.type===Y.link&&!e.kind||"string"===typeof e.kind)&&(e.type===Y.link&&!e.role||"string"===typeof e.role)&&"string"===typeof e.title&&"string"===typeof e.url&&(!("defaultImplementations"in e)||"number"===typeof e.defaultImplementations)&&(!("required"in e)||"boolean"===typeof e.required)&&(!("conformance"in e)||"object"===typeof e.conformance)}},data(){return{state:this.store.state}},computed:{linkComponent:({topic:e})=>e.type===Y.link?"a":"router-link",linkProps({topic:e}){const t=Object(o["b"])(e.url,this.$route.query);return e.type===Y.link?{href:t}:{to:t}},linkBlockClasses:({changesClasses:e,hasAbstractElements:t,hasMultipleLinesAfterAPIChanges:n,multipleLinesClass:a})=>({"has-inline-element":!t,[a]:n,...!t&&e}),linkClasses:({changesClasses:e,deprecated:t,hasAbstractElements:n})=>({deprecated:t,"has-adjacent-elements":n,...n&&e}),changesClasses:({getChangesClasses:e,change:t})=>e(t),titleTag({topic:e}){if(e.titleStyle===U.title)return e.ideTitle?"span":"code";if(e.role&&(e.role===i["a"].collection||e.role===i["a"].dictionarySymbol))return"span";switch(e.kind){case Q.symbol:return"code";default:return"span"}},titleStyles:()=>U,deprecated:({showDeprecatedBadge:e,topic:t})=>e||t.deprecated,showBetaBadge:({topic:e,isSymbolBeta:t})=>Boolean(!t&&e.beta),showDeprecatedBadge:({topic:e,isSymbolDeprecated:t})=>Boolean(!t&&e.deprecated),change({topic:{identifier:e},state:{apiChanges:t}}){return this.changeFor(e,t)},changeName:({change:e,getChangeName:t})=>t(e),hasAbstractElements:({topic:{abstract:e,conformance:t,required:n,defaultImplementations:a}}={})=>e&&e.length>0||t||n||a,tags:({topic:e})=>(e.tags||[]).slice(0,1),iconOverride:({topic:{images:e=[]}})=>{const t=e.find(({type:e})=>"icon"===e);return t?t.identifier:null}}},ee=Z,te=(n("b34c"),Object(y["a"])(ee,a,r,!1,null,"78eb2e68",null));t["default"]=te.exports},"2f04":function(e,t,n){},4782:function(e,t,n){},"52b6":function(e,t,n){"use strict";n("bcd6")},"5d59":function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l}));var a=n("b5cf"),r=n("9055"),i=n("beb1");const o="latest_",s={xcode:{value:"xcode",label:"Xcode"},other:{value:"other",label:"Other"}},c={constants:{multipleLinesClass:r["a"]},data(){return{multipleLinesClass:r["a"]}},computed:{hasMultipleLinesAfterAPIChanges:({change:e,changeType:t,$refs:n})=>!(!e&&!t)&&Object(i["a"])(n.apiChangesDiff)}},l={methods:{toVersionRange({platform:e,versions:t}){return`${e} ${t[0]} – ${e} ${t[1]}`},toOptionValue:e=>`${o}${e}`,toScope:e=>e.slice(o.length,e.length),getOptionsForDiffAvailability(e={}){return this.getOptionsForDiffAvailabilities([e])},getOptionsForDiffAvailabilities(e=[]){const t=e.reduce((e,t={})=>Object.keys(t).reduce((e,n)=>({...e,[n]:(e[n]||[]).concat(t[n])}),e),{}),n=Object.keys(t),a=n.reduce((e,n)=>{const a=t[n];return{...e,[n]:a.find(e=>e.platform===s.xcode.label)||a[0]}},{}),r=e=>({label:this.toVersionRange(a[e]),value:this.toOptionValue(e),platform:a[e].platform}),{sdk:i,beta:o,minor:c,major:l,...d}=a,p=[].concat(i?r("sdk"):[]).concat(o?r("beta"):[]).concat(c?r("minor"):[]).concat(l?r("major"):[]).concat(Object.keys(d).map(r));return this.splitOptionsPerPlatform(p)},changesClassesFor(e,t){const n=this.changeFor(e,t);return this.getChangesClasses(n)},getChangesClasses:e=>({["changed changed-"+e]:!!e}),changeFor(e,t){const{change:n}=(t||{})[e]||{};return n},splitOptionsPerPlatform(e){return e.reduce((e,t)=>{const n=t.platform===s.xcode.label?s.xcode.value:s.other.value;return e[n].push(t),e},{[s.xcode.value]:[],[s.other.value]:[]})},getChangeName(e){return a["b"][e]}},computed:{availableOptions({diffAvailability:e={},toOptionValue:t}){return new Set(Object.keys(e).map(t))}}}},6359:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("BaseContentNode",e._b({},"BaseContentNode",e.$props,!1))},r=[],i=n("5677"),o={name:"ContentNode",components:{BaseContentNode:i["default"]},props:i["default"].props,methods:i["default"].methods,BlockType:i["default"].BlockType,InlineType:i["default"].InlineType},s=o,c=(n("52b6"),n("2877")),l=Object(c["a"])(s,a,r,!1,null,"57dbbfd9",null);t["a"]=l.exports},"64cf":function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ContentNode",{staticClass:"conditional-constraints",attrs:{content:e.content}})},r=[],i=n("6359"),o={name:"ConditionalConstraints",components:{ContentNode:i["a"]},props:{constraints:i["a"].props.content,prefix:i["a"].props.content},computed:{content:({constraints:e,prefix:t,space:n})=>t.concat(n).concat(e),space:()=>({type:i["a"].InlineType.text,text:" "})}},s=o,c=(n("918a"),n("2877")),l=Object(c["a"])(s,a,r,!1,null,"1548fd90",null);t["a"]=l.exports},9055:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));const a="has-multiple-lines"},"918a":function(e,t,n){"use strict";n("a2b5")},"94ca":function(e,t,n){"use strict";n("4782")},a0fd:function(e,t,n){"use strict";var a=function(){var e,t=this,n=t.$createElement,a=t._self._c||n;return a("span",{staticClass:"badge",class:(e={},e["badge-"+t.variant]=t.variant,e),attrs:{role:"presentation"}},[t._t("default",(function(){return[t._v(t._s(t.text?t.$t(t.text):""))]}))],2)},r=[];const i={beta:"aside-kind.beta",deprecated:"aside-kind.deprecated"};var o={name:"Badge",props:{variant:{type:String,default:()=>""}},computed:{text:({variant:e})=>i[e]}},s=o,c=(n("94ca"),n("2877")),l=Object(c["a"])(s,a,r,!1,null,"8d6893ae",null);t["a"]=l.exports},a2b5:function(e,t,n){},b34c:function(e,t,n){"use strict";n("1195")},b5cf:function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return r})),n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));const a={added:"added",modified:"modified",deprecated:"deprecated"},r=[a.modified,a.added,a.deprecated],i={[a.modified]:"change-type.modified",[a.added]:"change-type.added",[a.deprecated]:"change-type.deprecated"},o={"change-type.modified":a.modified,"change-type.added":a.added,"change-type.deprecated":a.deprecated}},bcd6:function(e,t,n){},beb1:function(e,t,n){"use strict";function a(e){if(!e)return!1;const t=window.getComputedStyle(e.$el||e),n=(e.$el||e).offsetHeight,a=t.lineHeight?parseFloat(t.lineHeight):1,r=t.paddingTop?parseFloat(t.paddingTop):0,i=t.paddingBottom?parseFloat(t.paddingBottom):0,o=t.borderTopWidth?parseFloat(t.borderTopWidth):0,s=t.borderBottomWidth?parseFloat(t.borderBottomWidth):0,c=n-(r+i+o+s),l=c/a;return l>=2}n.d(t,"a",(function(){return a}))},c36f:function(e,t,n){"use strict";n("f8bd")},d94b:function(e,t,n){"use strict";n("fff0")},dcf6:function(e,t,n){"use strict";n("2f04")},e8ea:function(e,t,n){"use strict";var a=function(e,t){var n=t._c;return n("p",{staticClass:"requirement-metadata",class:t.data.staticClass},[n("strong",[t._v(t._s(t.parent.$t("required")))]),t.props.defaultImplementationsCount?[t._v(" "+t._s(t.parent.$tc("metadata.default-implementation",t.props.defaultImplementationsCount))+" ")]:t._e()],2)},r=[],i={name:"RequirementMetadata",props:{defaultImplementationsCount:{type:Number,default:0}}},o=i,s=n("2877"),c=Object(s["a"])(o,a,r,!0,null,null,null);t["a"]=c.exports},f8bd:function(e,t,n){},fff0:function(e,t,n){}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-bash.1b52852f.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-bash"],{f0f8:function(e,s){function t(e){const s=e.regex,t={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t,a]};a.contains.push(c);const o={className:"",begin:/\\"/},r={className:"string",begin:/'/,end:/'/},l={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),h={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],u=["true","false"],b={match:/(\/[a-z._-]+)+/},g=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],f=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:m,literal:u,built_in:[...g,...f,"set","shopt",...w,...k]},contains:[d,e.SHEBANG(),h,l,e.HASH_COMMENT_MODE,i,b,c,o,r,t]}}e.exports=t}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-c.d1db3f17.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-c"],{"1fe5":function(e,n){function s(e){const n=e.regex,s=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),t="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",i="<[^<>]+>",r="("+t+"|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional(i)+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},o="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+o+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},s,e.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0},p=n.optional(a)+e.IDENT_RE+"\\s*\\(",m=["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],_=["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],f={keyword:m,type:_,literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},b=[u,l,s,e.C_BLOCK_COMMENT_MODE,d,c],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:b.concat([{begin:/\(/,end:/\)/,keywords:f,contains:b.concat(["self"]),relevance:0}]),relevance:0},h={begin:"("+r+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:t,keywords:f,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(g,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[s,e.C_BLOCK_COMMENT_MODE,c,d,l,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",s,e.C_BLOCK_COMMENT_MODE,c,d,l]}]},l,s,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C",aliases:["h"],keywords:f,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:u,strings:c,keywords:f}}}e.exports=s}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-cpp.eaddddbe.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-cpp"],{"0209":function(e,t){function n(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",r="<[^<>]+>",s="(?!struct)("+a+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional(r)+")",c={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},o="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+o+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},_=t.optional(i)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],f=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],h=["NULL","false","nullopt","nullptr","true"],w=["_Pragma"],y={type:g,keyword:m,literal:h,built_in:w,_type_hints:f},v={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},k=[v,u,c,n,e.C_BLOCK_COMMENT_MODE,d,l],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:k.concat([{begin:/\(/,end:/\)/,keywords:y,contains:k.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+s+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:y,relevance:0},{begin:_,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,d,c,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,d,c]}]},c,n,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:y,illegal:"",keywords:y,contains:["self",c]},{begin:e.IDENT_RE+"::",keywords:y},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}e.exports=n}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-css.75eab1fe.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-css"],{ee8c:function(e,t){const o=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),i=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],a=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],n=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],l=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-height","max-width","min-height","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function s(e){const t=e.regex,s=o(e),d={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},c="and or not only",g=/@-?\w[\w]*(-\w+)*/,m="[a-zA-Z-][a-zA-Z0-9_-]*",p=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[s.BLOCK_COMMENT,d,s.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+m,relevance:0},s.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+a.join("|")+")"},{begin:":(:)?("+n.join("|")+")"}]},s.CSS_VARIABLE,{className:"attribute",begin:"\\b("+l.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[s.BLOCK_COMMENT,s.HEXCOLOR,s.IMPORTANT,s.CSS_NUMBER_MODE,...p,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},s.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:g},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:c,attribute:r.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...p,s.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+i.join("|")+")\\b"}]}}e.exports=s}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-custom-markdown.7cffc4b3.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-custom-markdown","highlight-js-markdown"],{"04b0":function(n,e){function a(n){const e=n.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},t={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},d=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,d,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},g={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},o={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};g.contains.push(o),o.contains.push(g);let r=[a,l];g.contains=g.contains.concat(r),o.contains=o.contains.concat(r),r=r.concat(g,o);const b={className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:r},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:r}]}]},u={className:"quote",begin:"^>\\s+",contains:r,end:"$"};return{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[b,a,t,g,o,u,s,i,l,c]}}n.exports=a},"84cb":function(n,e,a){"use strict";a.r(e);var i=a("04b0"),s=a.n(i);const t={begin:"",returnBegin:!0,contains:[{className:"link",begin:"doc:",end:">",excludeEnd:!0}]},c={className:"link",begin:/`{2}(?!`)/,end:/`{2}(?!`)/,excludeBegin:!0,excludeEnd:!0},d={begin:"^>\\s+[Note:|Tip:|Important:|Experiment:|Warning:]",end:"$",returnBegin:!0,contains:[{className:"quote",begin:"^>",end:"\\s+"},{className:"type",begin:"Note|Tip|Important|Experiment|Warning",end:":"},{className:"quote",begin:".*",end:"$",endsParent:!0}]},l={begin:"@",end:"[{\\)\\s]",returnBegin:!0,contains:[{className:"title",begin:"@",end:"[\\s+(]",excludeEnd:!0},{begin:":",end:"[,\\)\n\t]",excludeBegin:!0,keywords:{literal:"true false null undefined"},contains:[{className:"number",begin:"\\b([\\d_]+(\\.[\\deE_]+)?|0x[a-fA-F0-9_]+(\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\b",endsWithParent:!0,excludeEnd:!0},{className:"string",variants:[{begin:/"""/,end:/"""/},{begin:/"/,end:/"/}],endsParent:!0},{className:"link",begin:"http|https",endsWithParent:!0,excludeEnd:!0}]}]};e["default"]=function(n){const e=s()(n),a=e.contains.find(({className:n})=>"code"===n);a.variants=a.variants.filter(({begin:n})=>!n.includes("( {4}|\\t)"));const i=[...e.contains.filter(({className:n})=>"code"!==n),a];return{...e,contains:[c,t,d,l,...i]}}}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-custom-swift.5cda5c20.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-custom-swift","highlight-js-swift"],{"2a39":function(e,n){function t(e){return e?"string"===typeof e?e:e.source:null}function a(e){return i("(?=",e,")")}function i(...e){const n=e.map(e=>t(e)).join("");return n}function s(e){const n=e[e.length-1];return"object"===typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}function c(...e){const n=s(e),a="("+(n.capture?"":"?:")+e.map(e=>t(e)).join("|")+")";return a}const u=e=>i(/\b/,e,/\w$/.test(e)?/\b/:/\B/),o=["Protocol","Type"].map(u),r=["init","self"].map(u),l=["Any","Self"],m=["actor","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],d=["false","nil","true"],p=["assignment","associativity","higherThan","left","lowerThan","none","right"],F=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],b=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],f=c(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),h=c(f,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),w=i(f,h,"*"),y=c(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),g=c(y,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),E=i(y,g,"*"),v=i(/[A-Z]/,g,"*"),A=["autoclosure",i(/convention\(/,c("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",i(/objc\(/,E,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],N=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function k(e){const n={match:/\s+/,relevance:0},t=e.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[e.C_LINE_COMMENT_MODE,t],f={match:[/\./,c(...o,...r)],className:{2:"keyword"}},y={match:i(/\./,c(...m)),relevance:0},k=m.filter(e=>"string"===typeof e).concat(["_|0"]),C=m.filter(e=>"string"!==typeof e).concat(l).map(u),D={variants:[{className:"keyword",match:c(...C,...r)}]},B={$pattern:c(/\b\w+/,/#\w+/),keyword:k.concat(F),literal:d},_=[f,y,D],S={match:i(/\./,c(...b)),relevance:0},x={className:"built_in",match:i(/\b/,c(...b),/(?=\()/)},M=[S,x],I={match:/->/,relevance:0},$={className:"operator",relevance:0,variants:[{match:w},{match:`\\.(\\.|${h})+`}]},O=[I,$],L="([0-9]_*)+",T="([0-9a-fA-F]_*)+",j={className:"number",relevance:0,variants:[{match:`\\b(${L})(\\.(${L}))?([eE][+-]?(${L}))?\\b`},{match:`\\b0x(${T})(\\.(${T}))?([pP][+-]?(${L}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},K=(e="")=>({className:"subst",variants:[{match:i(/\\/,e,/[0\\tnr"']/)},{match:i(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),P=(e="")=>({className:"subst",match:i(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),z=(e="")=>({className:"subst",label:"interpol",begin:i(/\\/,e,/\(/),end:/\)/}),q=(e="")=>({begin:i(e,/"""/),end:i(/"""/,e),contains:[K(e),P(e),z(e)]}),U=(e="")=>({begin:i(e,/"/),end:i(/"/,e),contains:[K(e),z(e)]}),Z={className:"string",variants:[q(),q("#"),q("##"),q("###"),U(),U("#"),U("##"),U("###")]},V={match:i(/`/,E,/`/)},W={className:"variable",match:/\$\d+/},G={className:"variable",match:`\\$${g}+`},J=[V,W,G],R={match:/(@|#)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:N,contains:[...O,j,Z]}]}},X={className:"keyword",match:i(/@/,c(...A))},H={className:"meta",match:i(/@/,E)},Q=[R,X,H],Y={match:a(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:i(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,g,"+")},{className:"type",match:v,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,a(v)),relevance:0}]},ee={begin://,keywords:B,contains:[...s,..._,...Q,I,Y]};Y.contains.push(ee);const ne={match:i(E,/\s*:/),keywords:"_|0",relevance:0},te={begin:/\(/,end:/\)/,relevance:0,keywords:B,contains:["self",ne,...s,..._,...M,...O,j,Z,...J,...Q,Y]},ae={begin://,contains:[...s,Y]},ie={begin:c(a(i(E,/\s*:/)),a(i(E,/\s+/,E,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:E}]},se={begin:/\(/,end:/\)/,keywords:B,contains:[ie,...s,..._,...O,j,Z,...Q,Y,te],endsParent:!0,illegal:/["']/},ce={match:[/func/,/\s+/,c(V.match,E,w)],className:{1:"keyword",3:"title.function"},contains:[ae,se,n],illegal:[/\[/,/%/]},ue={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ae,se,n],illegal:/\[|%/},oe={match:[/operator/,/\s+/,w],className:{1:"keyword",3:"title"}},re={begin:[/precedencegroup/,/\s+/,v],className:{1:"keyword",3:"title"},contains:[Y],keywords:[...p,...d],end:/}/};for(const a of Z.variants){const e=a.contains.find(e=>"interpol"===e.label);e.keywords=B;const n=[..._,...M,...O,j,Z,...J];e.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:B,contains:[...s,ce,ue,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:B,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),..._]},oe,re,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},..._,...M,...O,j,Z,...J,...Q,Y,te]}}e.exports=k},"81c8":function(e,n,t){"use strict";t.r(n);var a=t("2a39"),i=t.n(a);n["default"]=function(e){const n=i()(e);n.keywords.keyword=[...n.keywords.keyword,"distributed"];const t=({beginKeywords:e=""})=>e.split(" ").includes("class"),a=n.contains.findIndex(t);if(a>=0){const{beginKeywords:e,...t}=n.contains[a];n.contains[a]={...t,begin:/\b(struct|protocol|extension|enum|actor|class\b(?!.*\bfunc))\b/}}return n}}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-diff.62d66733.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-diff"],{"48b8":function(e,n){function a(e){const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}e.exports=a}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-http.163e45b6.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-http"],{c01d:function(e,n){function a(e){const n=e.regex,a="HTTP/(2|1\\.[01])",s=/[A-Za-z][A-Za-z0-9-]*/,t={className:"attribute",begin:n.concat("^",s,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},i=[t,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+a+" \\d{3})",end:/$/,contains:[{className:"meta",begin:a},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},{begin:"(?=^[A-Z]+ (.*?) "+a+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:a},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},e.inherit(t,{relevance:0})]}}e.exports=a}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-java.8326d9d8.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-java"],{"332f":function(e,a){var n="[0-9](_*[0-9])*",s=`\\.(${n})`,i="[0-9a-fA-F](_*[0-9a-fA-F])*",t={className:"number",variants:[{begin:`(\\b(${n})((${s})|\\.)?|(${s}))[eE][+-]?(${n})[fFdD]?\\b`},{begin:`\\b(${n})((${s})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${s})[fFdD]?\\b`},{begin:`\\b(${n})[fFdD]\\b`},{begin:`\\b0[xX]((${i})\\.?|(${i})?\\.(${i}))[pP][+-]?(${n})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${i})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function r(e,a,n){return-1===n?"":e.replace(a,s=>r(e,a,n-1))}function c(e){e.regex;const a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=a+r("(?:<"+a+"~~~(?:\\s*,\\s*"+a+"~~~)*>)?",/~~~/g,2),s=["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do"],i=["super","this"],c=["false","true","null"],l=["char","boolean","long","float","int","byte","short","double"],o={keyword:s,literal:c,type:l,built_in:i},b={className:"meta",begin:"@"+a,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},_={className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:o,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:[a,/\s+/,a,/\s+/,/=/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,a],className:{1:"keyword",3:"title.class"},contains:[_,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:o,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,t,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},t,b]}}e.exports=c}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-javascript.acb8a8eb.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-javascript"],{"4dd1":function(e,n){const a="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],s=["true","false","null","undefined","NaN","Infinity"],c=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],r=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],i=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],o=["arguments","this","super","console","window","document","localStorage","module","global"],l=[].concat(i,c,r);function b(e){const n=e.regex,b=(e,{after:n})=>{const a="",end:""},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const a=e[0].length+e.index,t=e.input[a];if("<"===t||","===t)return void n.ignoreMatch();let s;">"===t&&(b(e,{after:a})||n.ignoreMatch());const c=e.input.substr(a);(s=c.match(/^\s+extends\s+/))&&0===s.index&&n.ignoreMatch()}},E={$pattern:a,keyword:t,literal:s,built_in:l,"variable.language":o},A="[0-9](_?[0-9])*",y=`\\.(${A})`,N="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${N})((${y})|\\.)?|(${y}))[eE][+-]?(${A})\\b`},{begin:`\\b(${N})\\b((${y})\\b|\\.)?|(${y})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:E,contains:[]},_={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},p={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w=e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:d+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),S={className:"comment",variants:[w,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,p,v,f];h.contains=R.concat({begin:/\{/,end:/\}/,keywords:E,contains:["self"].concat(R)});const k=[].concat(S,h.contains),O=k.concat([{begin:/\(/,end:/\)/,keywords:E,contains:["self"].concat(k)}]),I={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:E,contains:O},x={variants:[{match:[/class/,/\s+/,d,/\s+/,/extends/,/\s+/,n.concat(d,"(",n.concat(/\./,d),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,d],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]+|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+/),className:"title.class",keywords:{_:[...c,...r]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,d,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},B={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(e){return n.concat("(?!",e.join("|"),")")}const D={match:n.concat(/\b/,$([...i,"super"]),d,n.lookahead(/\(/)),className:"title.function",relevance:0},U={begin:n.concat(/\./,n.lookahead(n.concat(d,/(?![0-9A-Za-z$_(])/))),end:d,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,d,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,d,/\s*/,/=\s*/,n.lookahead(z)],className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:E,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,p,v,S,f,T,{className:"attr",begin:d+n.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:E,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:g.begin,end:g.end},{match:u},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:d,className:"title.function"})]},{match:/\.\.\./,relevance:0},U,{match:"\\$"+d,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},D,B,x,Z,{match:/\$[(.]/}]}}e.exports=b}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-json.471128d2.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-json"],{"5ad2":function(n,e){function a(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},s={beginKeywords:["true","false","null"].join(" ")};return{name:"JSON",contains:[e,a,n.QUOTE_STRING_MODE,s,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}n.exports=a}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-llvm.6100b125.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-llvm"],{"7c30":function(e,n){function a(e){const n=e.regex,a=/([-a-zA-Z$._][\w$.-]*)/,t={className:"type",begin:/\bi\d+(?=\s|\b)/},i={className:"operator",relevance:0,begin:/=/},c={className:"punctuation",relevance:0,begin:/,/},l={className:"number",variants:[{begin:/0[xX][a-fA-F0-9]+/},{begin:/-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?/}],relevance:0},r={className:"symbol",variants:[{begin:/^\s*[a-z]+:/}],relevance:0},s={className:"variable",variants:[{begin:n.concat(/%/,a)},{begin:/%\d+/},{begin:/#\d+/}]},o={className:"title",variants:[{begin:n.concat(/@/,a)},{begin:/@\d+/},{begin:n.concat(/!/,a)},{begin:n.concat(/!\d+/,a)},{begin:/!\d+/}]};return{name:"LLVM IR",keywords:"begin end true false declare define global constant private linker_private internal available_externally linkonce linkonce_odr weak weak_odr appending dllimport dllexport common default hidden protected extern_weak external thread_local zeroinitializer undef null to tail target triple datalayout volatile nuw nsw nnan ninf nsz arcp fast exact inbounds align addrspace section alias module asm sideeffect gc dbg linker_private_weak attributes blockaddress initialexec localdynamic localexec prefix unnamed_addr ccc fastcc coldcc x86_stdcallcc x86_fastcallcc arm_apcscc arm_aapcscc arm_aapcs_vfpcc ptx_device ptx_kernel intel_ocl_bicc msp430_intrcc spir_func spir_kernel x86_64_sysvcc x86_64_win64cc x86_thiscallcc cc c signext zeroext inreg sret nounwind noreturn noalias nocapture byval nest readnone readonly inlinehint noinline alwaysinline optsize ssp sspreq noredzone noimplicitfloat naked builtin cold nobuiltin noduplicate nonlazybind optnone returns_twice sanitize_address sanitize_memory sanitize_thread sspstrong uwtable returned type opaque eq ne slt sgt sle sge ult ugt ule uge oeq one olt ogt ole oge ord uno ueq une x acq_rel acquire alignstack atomic catch cleanup filter inteldialect max min monotonic nand personality release seq_cst singlethread umax umin unordered xchg add fadd sub fsub mul fmul udiv sdiv fdiv urem srem frem shl lshr ashr and or xor icmp fcmp phi call trunc zext sext fptrunc fpext uitofp sitofp fptoui fptosi inttoptr ptrtoint bitcast addrspacecast select va_arg ret br switch invoke unwind unreachable indirectbr landingpad resume malloc alloca free load store getelementptr extractelement insertelement shufflevector getresult extractvalue insertvalue atomicrmw cmpxchg fence argmemonly double",contains:[t,e.COMMENT(/;\s*$/,null,{relevance:0}),e.COMMENT(/;/,/$/),e.QUOTE_STRING_MODE,{className:"string",variants:[{begin:/"/,end:/[^\\]"/}]},o,c,i,s,r,l]}}e.exports=a}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-markdown.90077643.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-markdown"],{"04b0":function(n,e){function a(n){const e=n.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},t={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},g=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,g,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},l={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},o={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};l.contains.push(o),o.contains.push(l);let b=[a,d];l.contains=l.contains.concat(b),o.contains=o.contains.concat(b),b=b.concat(l,o);const r={className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},m={className:"quote",begin:"^>\\s+",contains:b,end:"$"};return{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[r,a,c,l,o,m,s,i,d,t]}}n.exports=a}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-objectivec.bcdf5156.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-objectivec"],{"9bf2":function(e,n){function _(e){const n={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},_=/[a-zA-Z@][a-zA-Z0-9_]*/,i=["int","float","while","char","export","sizeof","typedef","const","struct","for","union","unsigned","long","volatile","static","bool","mutable","if","do","return","goto","void","enum","else","break","extern","asm","case","short","default","double","register","explicit","signed","typename","this","switch","continue","wchar_t","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","super","unichar","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],t=["false","true","FALSE","TRUE","nil","YES","NO","NULL"],a=["BOOL","dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],o={$pattern:_,keyword:i,literal:t,built_in:a},s={$pattern:_,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+s.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:s,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}e.exports=_}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-perl.757d7b6f.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-perl"],{"6a51":function(e,n){function t(e){const n=e.regex,t=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:t.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},a={begin:/->\{/,end:/\}/},o={variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},c=[e.BACKSLASH_ESCAPE,i,o],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],l=(e,t,r="\\1")=>{const i="\\1"===r?r:n.concat(r,t);return n.concat(n.concat("(?:",e,")"),t,/(?:\\.|[^\\\/])*?/,i,/(?:\\.|[^\\\/])*?/,r,s)},d=(e,t,r)=>n.concat(n.concat("(?:",e,")"),t,/(?:\\.|[^\\\/])*?/,r,s),p=[o,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:l("s|tr|y",n.either(...g,{capture:!0}))},{begin:l("s|tr|y","\\(","\\)")},{begin:l("s|tr|y","\\[","\\]")},{begin:l("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",n.either(...g,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=p,a.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:p}}e.exports=t}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-php.cc8d6c27.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-php"],{2907:function(e,r){function t(e){const r={className:"variable",begin:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*(?![A-Za-z0-9])(?![$])"},t={className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{begin:/\?>/}]},a={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},n=e.inherit(e.APOS_STRING_MODE,{illegal:null}),i=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),o=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),l={className:"string",contains:[e.BACKSLASH_ESCAPE,t],variants:[e.inherit(n,{begin:"b'",end:"'"}),e.inherit(i,{begin:'b"',end:'"'}),i,n,o]},c={className:"number",variants:[{begin:"\\b0b[01]+(?:_[01]+)*\\b"},{begin:"\\b0o[0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:e[+-]?\\d+)?"}],relevance:0},s={keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list match|0 mixed new object or private protected public real return string switch throw trait try unset use var void while xor yield",literal:"false null true",built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException UnhandledMatchError ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Stringable Throwable Traversable WeakReference WeakMap Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass"};return{case_insensitive:!0,keywords:s,contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$",{contains:[t]}),e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0,keywords:"__halt_compiler"}),t,{className:"keyword",begin:/\$this\b/},r,{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{className:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",r,e.C_BLOCK_COMMENT_MODE,l,c]}]},{className:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",relevance:0,end:";",contains:[e.UNDERSCORE_TITLE_MODE]},l,c]}}e.exports=t}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-python.c214ed92.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-python"],{9510:function(e,n){function a(e){const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s=["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],t=["__debug__","Ellipsis","False","None","NotImplemented","True"],r=["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:s,literal:t,type:r},o={className:"meta",begin:/^(>>>|\.\.\.) /},b={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},c={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,c,b]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,c,b]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,c,b]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,c,b]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",g=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${g}))[eE][+-]?(${p})[jJ]?\\b`},{begin:`(${g})[jJ]?`},{begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${p})[jJ]\\b`}]},_={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},u={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",o,m,d,e.HASH_COMMENT_MODE]}]};return b.contains=[d,m,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|->|\?)|=>/,contains:[o,m,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},d,_,e.HASH_COMMENT_MODE,{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[u]},{variants:[{match:[/class/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/class/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,u,d]}]}}e.exports=a}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-ruby.f889d392.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-ruby"],{"82cb":function(e,n){function a(e){const n=e.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__",built_in:"proc lambda",literal:"true false nil"},s={className:"doctag",begin:"@[A-Za-z]+"},b={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__","\\n$")],r={className:"subst",begin:/#\{/,end:/\}/,keywords:i},d={className:"string",contains:[e.BACKSLASH_ESCAPE,r],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,r]})]}]},t="[1-9](_?[0-9])*|0",o="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${t})(\\.(${o}))?([eE][+-]?(${o})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},l={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:i},_=[d,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE,relevance:0}]}].concat(c)},{className:"function",begin:n.concat(/def\s+/,n.lookahead(a+"\\s*(\\(|;|$)")),relevance:0,keywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:a}),l].concat(c)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:a}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:i},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,r],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(b,c),relevance:0}].concat(b,c);r.contains=_,l.contains=_;const w="[>?]>",E="[\\w#]+\\(\\w+\\):\\d+:\\d+>",u="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",N=[{begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta",begin:"^("+w+"|"+E+"|"+u+")(?=[ ])",starts:{end:"$",contains:_}}];return c.unshift(b),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:i,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(N).concat(c).concat(_)}}e.exports=a}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-scss.62ee18da.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-scss"],{6113:function(e,t){const i=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),o=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],a=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],n=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],l=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-height","max-width","min-height","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function s(e){const t=i(e),s=n,d=a,c="@[a-z-]+",p="and or not only",g="[a-zA-Z-][a-zA-Z0-9_-]*",m={className:"variable",begin:"(\\$"+g+")\\b"};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+o.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+d.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+s.join("|")+")"},m,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+l.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,m,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT]},{begin:"@(page|font-face)",keywords:{$pattern:c,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:p,attribute:r.join(" ")},contains:[{begin:c,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},m,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}e.exports=s}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-shell.dd7f411f.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-shell"],{b65b:function(s,n){function e(s){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}s.exports=e}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-swift.84f3e88c.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-swift"],{"2a39":function(e,n){function a(e){return e?"string"===typeof e?e:e.source:null}function t(e){return i("(?=",e,")")}function i(...e){const n=e.map(e=>a(e)).join("");return n}function s(e){const n=e[e.length-1];return"object"===typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}function u(...e){const n=s(e),t="("+(n.capture?"":"?:")+e.map(e=>a(e)).join("|")+")";return t}const c=e=>i(/\b/,e,/\w$/.test(e)?/\b/:/\B/),o=["Protocol","Type"].map(c),r=["init","self"].map(c),l=["Any","Self"],m=["actor","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],p=["false","nil","true"],d=["assignment","associativity","higherThan","left","lowerThan","none","right"],F=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],b=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],h=u(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),f=u(h,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),w=i(h,f,"*"),y=u(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),g=u(y,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),E=i(y,g,"*"),v=i(/[A-Z]/,g,"*"),A=["autoclosure",i(/convention\(/,u("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",i(/objc\(/,E,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],N=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function C(e){const n={match:/\s+/,relevance:0},a=e.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[e.C_LINE_COMMENT_MODE,a],h={match:[/\./,u(...o,...r)],className:{2:"keyword"}},y={match:i(/\./,u(...m)),relevance:0},C=m.filter(e=>"string"===typeof e).concat(["_|0"]),k=m.filter(e=>"string"!==typeof e).concat(l).map(c),D={variants:[{className:"keyword",match:u(...k,...r)}]},B={$pattern:u(/\b\w+/,/#\w+/),keyword:C.concat(F),literal:p},_=[h,y,D],S={match:i(/\./,u(...b)),relevance:0},M={className:"built_in",match:i(/\b/,u(...b),/(?=\()/)},x=[S,M],$={match:/->/,relevance:0},I={className:"operator",relevance:0,variants:[{match:w},{match:`\\.(\\.|${f})+`}]},O=[$,I],L="([0-9]_*)+",T="([0-9a-fA-F]_*)+",j={className:"number",relevance:0,variants:[{match:`\\b(${L})(\\.(${L}))?([eE][+-]?(${L}))?\\b`},{match:`\\b0x(${T})(\\.(${T}))?([pP][+-]?(${L}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},P=(e="")=>({className:"subst",variants:[{match:i(/\\/,e,/[0\\tnr"']/)},{match:i(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),K=(e="")=>({className:"subst",match:i(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),z=(e="")=>({className:"subst",label:"interpol",begin:i(/\\/,e,/\(/),end:/\)/}),q=(e="")=>({begin:i(e,/"""/),end:i(/"""/,e),contains:[P(e),K(e),z(e)]}),U=(e="")=>({begin:i(e,/"/),end:i(/"/,e),contains:[P(e),z(e)]}),Z={className:"string",variants:[q(),q("#"),q("##"),q("###"),U(),U("#"),U("##"),U("###")]},V={match:i(/`/,E,/`/)},W={className:"variable",match:/\$\d+/},G={className:"variable",match:`\\$${g}+`},J=[V,W,G],R={match:/(@|#)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:N,contains:[...O,j,Z]}]}},X={className:"keyword",match:i(/@/,u(...A))},H={className:"meta",match:i(/@/,E)},Q=[R,X,H],Y={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:i(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,g,"+")},{className:"type",match:v,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,t(v)),relevance:0}]},ee={begin://,keywords:B,contains:[...s,..._,...Q,$,Y]};Y.contains.push(ee);const ne={match:i(E,/\s*:/),keywords:"_|0",relevance:0},ae={begin:/\(/,end:/\)/,relevance:0,keywords:B,contains:["self",ne,...s,..._,...x,...O,j,Z,...J,...Q,Y]},te={begin://,contains:[...s,Y]},ie={begin:u(t(i(E,/\s*:/)),t(i(E,/\s+/,E,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:E}]},se={begin:/\(/,end:/\)/,keywords:B,contains:[ie,...s,..._,...O,j,Z,...Q,Y,ae],endsParent:!0,illegal:/["']/},ue={match:[/func/,/\s+/,u(V.match,E,w)],className:{1:"keyword",3:"title.function"},contains:[te,se,n],illegal:[/\[/,/%/]},ce={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[te,se,n],illegal:/\[|%/},oe={match:[/operator/,/\s+/,w],className:{1:"keyword",3:"title"}},re={begin:[/precedencegroup/,/\s+/,v],className:{1:"keyword",3:"title"},contains:[Y],keywords:[...d,...p],end:/}/};for(const t of Z.variants){const e=t.contains.find(e=>"interpol"===e.label);e.keywords=B;const n=[..._,...x,...O,j,Z,...J];e.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:B,contains:[...s,ue,ce,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:B,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),..._]},oe,re,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},..._,...x,...O,j,Z,...J,...Q,Y,ae]}}e.exports=C}}]); -------------------------------------------------------------------------------- /docs/js/highlight-js-xml.9c3688c7.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-xml"],{"8dcb":function(e,n){function a(e){const n=e.regex,a=n.concat(/[A-Z_]/,n.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),s=/[A-Za-z0-9._:-]+/,t={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=e.inherit(i,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),r=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,r,l,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,c,r,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},t,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:g}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}e.exports=a}}]); -------------------------------------------------------------------------------- /docs/metadata.json: -------------------------------------------------------------------------------- 1 | {"bundleDisplayName":"ExtractCaseValue","bundleIdentifier":"ExtractCaseValue","schemaVersion":{"major":0,"minor":1,"patch":0}} --------------------------------------------------------------------------------