├── .dir-locals.el ├── .github ├── FUNDING.yml └── workflows │ └── CI.yml ├── .gitignore ├── .spi.yml ├── .swiftlint.yml ├── .swiftpm └── xcode │ ├── package.xcworkspace │ └── contents.xcworkspacedata │ └── xcshareddata │ ├── xcbaselines │ └── MathParserTests.xcbaseline │ │ ├── 86E03732-FEDA-48F2-ACF3-D768F3C52CD6.plist │ │ └── Info.plist │ └── xcschemes │ ├── MathParser.xcscheme │ ├── MathParser_watchOS.xcscheme │ ├── swift-math-parser-Package.xcscheme │ └── swift-math-parser.xcscheme ├── LICENSE ├── Makefile ├── MathParser.docc └── README.md ├── Package.resolved ├── Package.swift ├── README.md ├── Sources └── MathParser │ ├── Dictionary-extension.swift │ ├── Documentation.docc │ ├── CustomSymbols.md │ ├── GettinStarted.md │ └── ImpliedMultiplication.md │ ├── Double-extension.swift │ ├── Evaluator.swift │ ├── InfixOperation.swift │ ├── MathParser.swift │ ├── MathParserError.swift │ ├── Token.swift │ └── Utils.swift ├── Tests └── MathParserTests │ ├── MathParserTests.swift │ ├── TestWolfram.swift │ ├── TokenTests.swift │ └── UtilsTests.swift ├── docs ├── css │ ├── chunk-384ef189.7ede1ea3.css │ ├── documentation-topic.29351f99.css │ ├── documentation-topic~topic.fccbd76c.css │ ├── documentation-topic~topic~tutorials-overview.1099452b.css │ ├── index.d5b499b0.css │ ├── topic.726a35dc.css │ └── tutorials-overview.2a582c39.css ├── data │ └── documentation │ │ ├── mathparser.json │ │ └── mathparser │ │ ├── customsymbols.json │ │ ├── evaluator.json │ │ ├── evaluator │ │ ├── eval(_:value:).json │ │ ├── eval(variables:unaryfunctions:binaryfunctions:).json │ │ ├── evalresult(_:value:).json │ │ ├── evalresult(variables:unaryfunctions:binaryfunctions:).json │ │ ├── result.json │ │ ├── unresolved.json │ │ └── value.json │ │ ├── gettinstarted.json │ │ ├── impliedmultiplication.json │ │ ├── mathparser.json │ │ ├── mathparser │ │ ├── binaryfunction.json │ │ ├── binaryfunctiondict.json │ │ ├── binaryfunctionmap.json │ │ ├── binaryfunctions.json │ │ ├── defaultbinaryfunctions.json │ │ ├── defaultunaryfunctions.json │ │ ├── defaultvariables.json │ │ ├── init(variables:variabledict:unaryfunctions:unaryfunctiondict:binaryfunctions:binaryfunctiondict:enableimpliedmultiplication:).json │ │ ├── parse(_:).json │ │ ├── parseresult(_:).json │ │ ├── result.json │ │ ├── unaryfunction.json │ │ ├── unaryfunctiondict.json │ │ ├── unaryfunctionmap.json │ │ ├── unaryfunctions.json │ │ ├── variabledict.json │ │ ├── variablemap.json │ │ └── variables.json │ │ ├── mathparsererror.json │ │ ├── mathparsererror │ │ ├── !=(_:_:).json │ │ ├── binaryfunctionnotfound(name:).json │ │ ├── customstringconvertible-implementations.json │ │ ├── description.json │ │ ├── equatable-implementations.json │ │ ├── error-implementations.json │ │ ├── localizeddescription.json │ │ ├── parsefailure(context:).json │ │ ├── unaryfunctionnotfound(name:).json │ │ └── variablenotfound(name:).json │ │ ├── unresolved.json │ │ └── unresolved │ │ ├── binaryfunctions.json │ │ ├── count.json │ │ ├── isempty.json │ │ ├── unaryfunctions.json │ │ └── variables.json ├── developer-og-twitter.jpg ├── developer-og.jpg ├── documentation │ └── mathparser │ │ ├── customsymbols │ │ └── index.html │ │ ├── evaluator │ │ ├── eval(_:value:) │ │ │ └── index.html │ │ ├── eval(variables:unaryfunctions:binaryfunctions:) │ │ │ └── index.html │ │ ├── evalresult(_:value:) │ │ │ └── index.html │ │ ├── evalresult(variables:unaryfunctions:binaryfunctions:) │ │ │ └── index.html │ │ ├── index.html │ │ ├── result │ │ │ └── index.html │ │ ├── unresolved │ │ │ └── index.html │ │ └── value │ │ │ └── index.html │ │ ├── gettinstarted │ │ └── index.html │ │ ├── impliedmultiplication │ │ └── index.html │ │ ├── index.html │ │ ├── mathparser │ │ ├── binaryfunction │ │ │ └── index.html │ │ ├── binaryfunctiondict │ │ │ └── index.html │ │ ├── binaryfunctionmap │ │ │ └── index.html │ │ ├── binaryfunctions │ │ │ └── index.html │ │ ├── defaultbinaryfunctions │ │ │ └── index.html │ │ ├── defaultunaryfunctions │ │ │ └── index.html │ │ ├── defaultvariables │ │ │ └── index.html │ │ ├── index.html │ │ ├── init(variables:variabledict:unaryfunctions:unaryfunctiondict:binaryfunctions:binaryfunctiondict:enableimpliedmultiplication:) │ │ │ └── index.html │ │ ├── parse(_:) │ │ │ └── index.html │ │ ├── parseresult(_:) │ │ │ └── index.html │ │ ├── result │ │ │ └── index.html │ │ ├── unaryfunction │ │ │ └── index.html │ │ ├── unaryfunctiondict │ │ │ └── index.html │ │ ├── unaryfunctionmap │ │ │ └── index.html │ │ ├── unaryfunctions │ │ │ └── index.html │ │ ├── variabledict │ │ │ └── index.html │ │ ├── variablemap │ │ │ └── index.html │ │ └── variables │ │ │ └── index.html │ │ ├── mathparsererror │ │ ├── !=(_:_:) │ │ │ └── index.html │ │ ├── binaryfunctionnotfound(name:) │ │ │ └── index.html │ │ ├── customstringconvertible-implementations │ │ │ └── index.html │ │ ├── description │ │ │ └── index.html │ │ ├── equatable-implementations │ │ │ └── index.html │ │ ├── error-implementations │ │ │ └── index.html │ │ ├── index.html │ │ ├── localizeddescription │ │ │ └── index.html │ │ ├── parsefailure(context:) │ │ │ └── index.html │ │ ├── unaryfunctionnotfound(name:) │ │ │ └── index.html │ │ └── variablenotfound(name:) │ │ │ └── index.html │ │ └── unresolved │ │ ├── binaryfunctions │ │ └── index.html │ │ ├── count │ │ └── index.html │ │ ├── index.html │ │ ├── isempty │ │ └── index.html │ │ ├── unaryfunctions │ │ └── index.html │ │ └── variables │ │ └── index.html ├── favicon.ico ├── favicon.svg ├── 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-384ef189.bb1ed903.js │ ├── chunk-vendors.b24b7aaa.js │ ├── documentation-topic.2ed269e3.js │ ├── documentation-topic~topic.900fc80c.js │ ├── documentation-topic~topic~tutorials-overview.5b27b87b.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.aa320932.js │ ├── topic.bb695832.js │ └── tutorials-overview.2cadc732.js └── metadata.json └── swiftlang.dockerfile /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((nil . ((projectile-project-compilation-cmd . "make ")))) 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: bradhowes 2 | -------------------------------------------------------------------------------- /.github/workflows/CI.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | branches: 8 | - main 9 | 10 | jobs: 11 | build_macos: 12 | runs-on: macos-12 13 | strategy: 14 | matrix: 15 | xcode: 16 | - "14.2" 17 | steps: 18 | - uses: actions/checkout@v3 19 | - name: Select Xcode ${{ matrix.xcode }} 20 | run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app 21 | - name: Run make 22 | run: env && make 23 | - name: Get Test Coverage 24 | run: | 25 | set -- $(< percentage.txt) 26 | echo "PERCENTAGE=${1}" >> $GITHUB_ENV 27 | - name: Create Coverage Badge 28 | uses: schneegans/dynamic-badges-action@v1.1.0 29 | with: 30 | auth: ${{ secrets.GIST_UPDATE }} 31 | gistID: ad941184ed256708952a2057fc5d7bb4 32 | filename: swift-math-parser-coverage.json 33 | label: Coverage 34 | message: ${{ env.PERCENTAGE }} 35 | color: success 36 | 37 | build_ubuntu: 38 | strategy: 39 | matrix: 40 | os: [ubuntu-20.04] 41 | 42 | runs-on: ${{ matrix.os }} 43 | 44 | steps: 45 | - uses: actions/checkout@v3 46 | - name: Build 47 | run: swift build 48 | - name: Run tests 49 | run: swift test 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | .DerivedData-macos/ 7 | .DerivedData-ios/ 8 | .DerivedData-tvos/ 9 | .workspace/ 10 | coverage.txt 11 | percentage.txt 12 | /.swiftpm/xcode/xcshareddata/xcschemes/swift-math-parser.xcschemes 13 | -------------------------------------------------------------------------------- /.spi.yml: -------------------------------------------------------------------------------- 1 | version: 1 2 | builder: 3 | configs: 4 | - platform: ios 5 | scheme: MathParser 6 | - platform: tvos 7 | scheme: MathParser 8 | - platform: watchos 9 | scheme: MathParser_watchOS 10 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | opt_in_rules: 2 | - empty_count 3 | 4 | included: # paths to include during linting. `--path` is ignored if present. 5 | - Sources 6 | 7 | # Xcode guidepost at 120 but do not warn until 140 and error at 240 8 | line_length: 9 | warning: 140 10 | error: 240 11 | ignores_comments: true 12 | ignores_urls: true 13 | 14 | # or they can set both explicitly 15 | file_length: 16 | warning: 1000 17 | error: 2000 18 | 19 | # naming rules can set warnings/errors for min_length and max_length 20 | # additionally they can set excluded names 21 | type_name: 22 | min_length: 3 # only warning 23 | max_length: # warning and error 24 | warning: 40 25 | error: 50 26 | excluded: iPhone # excluded via string 27 | allowed_symbols: ["_"] # these are allowed in type names 28 | 29 | identifier_name: 30 | min_length: 2 # only warning 31 | 32 | excluded: # excluded via string array 33 | - id 34 | - URL 35 | - GlobalAPIKey 36 | reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube, markdown) 37 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.swiftpm/xcode/xcshareddata/xcbaselines/MathParserTests.xcbaseline/86E03732-FEDA-48F2-ACF3-D768F3C52CD6.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | classNames 6 | 7 | TestWolfram 8 | 9 | testPerformance() 10 | 11 | com.apple.XCTPerformanceMetric_WallClockTime 12 | 13 | baselineAverage 14 | 0.285000 15 | baselineIntegrationDisplayName 16 | Local Baseline 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.swiftpm/xcode/xcshareddata/xcbaselines/MathParserTests.xcbaseline/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | runDestinationsByUUID 6 | 7 | 86E03732-FEDA-48F2-ACF3-D768F3C52CD6 8 | 9 | localComputer 10 | 11 | busSpeedInMHz 12 | 0 13 | cpuCount 14 | 1 15 | cpuKind 16 | Apple M1 Pro 17 | cpuSpeedInMHz 18 | 0 19 | logicalCPUCoresPerPackage 20 | 10 21 | modelCode 22 | MacBookPro18,1 23 | physicalCPUCoresPerPackage 24 | 10 25 | platformIdentifier 26 | com.apple.platform.macosx 27 | 28 | targetArchitecture 29 | arm64 30 | targetDevice 31 | 32 | modelCode 33 | iPad14,5 34 | platformIdentifier 35 | com.apple.platform.iphonesimulator 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /.swiftpm/xcode/xcshareddata/xcschemes/MathParser.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 | 69 | 75 | 76 | 82 | 83 | 84 | 85 | 87 | 88 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /.swiftpm/xcode/xcshareddata/xcschemes/MathParser_watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /.swiftpm/xcode/xcshareddata/xcschemes/swift-math-parser-Package.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 | 69 | 75 | 76 | 82 | 83 | 84 | 85 | 87 | 88 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /.swiftpm/xcode/xcshareddata/xcschemes/swift-math-parser.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 | 69 | 75 | 76 | 82 | 83 | 84 | 85 | 87 | 88 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Brad Howes 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 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PLATFORM_IOS = iOS Simulator,name=iPhone 14 Pro 2 | PLATFORM_MACOS = macOS 3 | PLATFORM_TVOS = tvOS Simulator,name=Apple TV 4K (3rd generation) (at 1080p) 4 | TARGET = MathParser 5 | DOCC_DIR = ./docs 6 | QUIET = -quiet 7 | WORKSPACE = $(PWD)/.workspace 8 | 9 | default: percentage 10 | 11 | clean: 12 | rm -rf "$(PWD)/.DerivedData-macos" "$(PWD)/.DerivedData-ios" "$(PWD)/.DerivedData-tvos" "$(WORKSPACE)" 13 | 14 | docc: 15 | DOCC_JSON_PRETTYPRINT="YES" \ 16 | swift package \ 17 | --allow-writing-to-directory $(DOCC_DIR) \ 18 | generate-documentation \ 19 | --target $(TARGET) \ 20 | --disable-indexing \ 21 | --transform-for-static-hosting \ 22 | --hosting-base-path swift-math-parser \ 23 | --output-path $(DOCC_DIR) 24 | 25 | lint: clean 26 | @if command -v swiftlint; then swiftlint; fi 27 | 28 | resolve-deps: lint 29 | xcodebuild \ 30 | $(QUIET) \ 31 | -resolvePackageDependencies \ 32 | -clonedSourcePackagesDirPath "$(WORKSPACE)" \ 33 | -scheme $(TARGET) 34 | 35 | test-ios: resolve-deps 36 | xcodebuild test \ 37 | $(QUIET) \ 38 | -clonedSourcePackagesDirPath "$(WORKSPACE)" \ 39 | -scheme $(TARGET) \ 40 | -derivedDataPath "$(PWD)/.DerivedData-ios" \ 41 | -destination platform="$(PLATFORM_IOS)" 42 | 43 | test-tvos: resolve-deps 44 | xcodebuild test \ 45 | $(QUIET) \ 46 | -clonedSourcePackagesDirPath "$(WORKSPACE)" \ 47 | -scheme $(TARGET) \ 48 | -derivedDataPath "$(PWD)/.DerivedData-tvos" \ 49 | -destination platform="$(PLATFORM_TVOS)" 50 | 51 | test-macos: resolve-deps 52 | xcodebuild build-for-testing \ 53 | $(QUIET) \ 54 | -clonedSourcePackagesDirPath "$(WORKSPACE)" \ 55 | -scheme $(TARGET) \ 56 | -derivedDataPath "$(PWD)/.DerivedData-macos" \ 57 | -destination platform="$(PLATFORM_MACOS)" 58 | xcodebuild test-without-building \ 59 | $(QUIET) \ 60 | -clonedSourcePackagesDirPath "$(WORKSPACE)" \ 61 | -scheme $(TARGET) \ 62 | -derivedDataPath "$(PWD)/.DerivedData-macos" \ 63 | -destination platform="$(PLATFORM_MACOS)" \ 64 | -enableCodeCoverage YES 65 | 66 | test-linux: lint 67 | docker build -t swiftlang -f swiftlang.dockerfile . 68 | docker run \ 69 | --rm \ 70 | -v "$(PWD):$(PWD)" \ 71 | -w "$(PWD)" \ 72 | swift57 \ 73 | bash -c 'make test-swift' 74 | 75 | test-swift: lint 76 | swift test --parallel 77 | 78 | coverage: test-macos 79 | xcrun xccov view --report --only-targets $(PWD)/.DerivedData-macos/Logs/Test/*.xcresult > coverage.txt 80 | cat coverage.txt 81 | 82 | percentage: coverage 83 | awk '/ $(TARGET) / { if ($$3 > 0) print $$4; }' coverage.txt > percentage.txt 84 | cat percentage.txt 85 | 86 | test: test-ios test-tvos percentage 87 | 88 | .PHONY: test test-ios test-macos test-tvos coverage percentage test-linux test-swift 89 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "swift-case-paths", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/pointfreeco/swift-case-paths", 7 | "state" : { 8 | "revision" : "b871e5ed11a23e52c2896a92ce2c829982ff8619", 9 | "version" : "1.4.2" 10 | } 11 | }, 12 | { 13 | "identity" : "swift-docc-plugin", 14 | "kind" : "remoteSourceControl", 15 | "location" : "https://github.com/apple/swift-docc-plugin", 16 | "state" : { 17 | "revision" : "26ac5758409154cc448d7ab82389c520fa8a8247", 18 | "version" : "1.3.0" 19 | } 20 | }, 21 | { 22 | "identity" : "swift-docc-symbolkit", 23 | "kind" : "remoteSourceControl", 24 | "location" : "https://github.com/apple/swift-docc-symbolkit", 25 | "state" : { 26 | "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", 27 | "version" : "1.0.0" 28 | } 29 | }, 30 | { 31 | "identity" : "swift-parsing", 32 | "kind" : "remoteSourceControl", 33 | "location" : "https://github.com/pointfreeco/swift-parsing", 34 | "state" : { 35 | "revision" : "a0e7d73f462c1c38c59dc40a3969ac40cea42950", 36 | "version" : "0.13.0" 37 | } 38 | }, 39 | { 40 | "identity" : "swift-syntax", 41 | "kind" : "remoteSourceControl", 42 | "location" : "https://github.com/apple/swift-syntax", 43 | "state" : { 44 | "revision" : "303e5c5c36d6a558407d364878df131c3546fad8", 45 | "version" : "510.0.2" 46 | } 47 | }, 48 | { 49 | "identity" : "xctest-dynamic-overlay", 50 | "kind" : "remoteSourceControl", 51 | "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", 52 | "state" : { 53 | "revision" : "6f30bdba373bbd7fbfe241dddd732651f2fbd1e2", 54 | "version" : "1.1.2" 55 | } 56 | } 57 | ], 58 | "version" : 2 59 | } 60 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.7 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "swift-math-parser", 7 | platforms: [ 8 | .iOS(.v13), 9 | .macOS(.v10_15), 10 | .tvOS(.v13), 11 | .watchOS(.v6), 12 | ], 13 | products: [ 14 | .library( 15 | name: "MathParser", 16 | targets: ["MathParser"] 17 | ) 18 | ], 19 | dependencies: [ 20 | .package(url: "https://github.com/pointfreeco/swift-parsing", from: "0.12.0"), 21 | ], 22 | targets: [ 23 | .target( 24 | name: "MathParser", 25 | dependencies: [.product(name: "Parsing", package: "swift-parsing")] 26 | ), 27 | .testTarget( 28 | name: "MathParserTests", 29 | dependencies: [.product(name: "Parsing", package: "swift-parsing"), "MathParser"] 30 | ) 31 | ] 32 | ) 33 | 34 | #if swift(>=5.6) 35 | // Add the documentation compiler plugin if possible 36 | package.dependencies.append( 37 | .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0") 38 | ) 39 | #endif 40 | -------------------------------------------------------------------------------- /Sources/MathParser/Dictionary-extension.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 Brad Howes. All rights reserved. 2 | 3 | public extension Dictionary where Key == String, Value == Double { 4 | /// Obtain a symbol mapping function for the dictionary 5 | @inlinable var producer: MathParser.VariableMap { { self[$0] } } 6 | } 7 | 8 | public extension Dictionary where Key == String, Value == (Double) -> Double { 9 | /// Obtain a unary function mapping function for the dictionary 10 | @inlinable var producer: MathParser.UnaryFunctionMap { { self[$0] } } 11 | } 12 | 13 | public extension Dictionary where Key == String, Value == (Double, Double) -> Double { 14 | /// Obtain a binary function mapping function for the dictionary 15 | @inlinable var producer: MathParser.BinaryFunctionMap { { self[$0] } } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/MathParser/Documentation.docc/CustomSymbols.md: -------------------------------------------------------------------------------- 1 | # Custom Symbols 2 | 3 | The ``MathParser`` package tries to offer a great out-of-the-box experience without any configuration. It also offers 4 | a way to integrate your own functionality by way of providing custom variables and functions which the parser and 5 | evaluator can then use to successfully resolve and evaluate your math expressions. 6 | 7 | By default, ``MathParser`` provides two constants (`π` and `e`) and a large number of common functions by default for 8 | all math expression parsing and evaluation. 9 | 10 | The functions provided are those that are often used in math and programming: 11 | 12 | - 1-argument functions: `sin`, `asin`, `cos`, `acos`, `tan`, `atan`, `log10`, `ln` (`loge`), `log2`, `exp`, `ceil`, 13 | `floor`, `round`, `sqrt` (`√`), `cbrt` (cube root), `abs`, `sgn` 14 | - 2-argument functions: `atan`, `hypot`, `pow` 15 | 16 | You can also provide additional definitions or redefine the defaults by providing your own mapping function for any or 17 | all of the three collections (variables, 1-arg (unary) functions, and 2-arg (binary) functions). 18 | 19 | ## Customized Parsing 20 | 21 | Below shows how to provide to the parser a custom unary function called `twice` that returns twice the value it 22 | receives, and a custom variable called `foo` which holds the constant `123.4`. 23 | 24 | ```swift 25 | let myVariables = ["foo": 123.4] 26 | let myFunctions: [String:(Double)->Double] = ["twice": {$0 + $0}] 27 | let parser = MathParser(variables: myVariables.producer, unaryFunctions: myFunctions.producer) 28 | let evaluator = parser.parse("power(twice(foo))") 29 | ``` 30 | 31 | In the above parsed expression `power(twice(foo))` everything is resolved except for `power`. Since the expression is a 32 | valid one according to ``MathParser``, the returned `evaluator` is not `nil`, but asking the evaluator for a value now 33 | will return a `NaN` because of the undefined `power` function. 34 | 35 | ```swift 36 | evaluator?.value // => nan 37 | ``` 38 | 39 | In this example, we know that `power` must be a function because the parser was not created with implied multiplication 40 | enabled. If that had not been the case, then the unknown `power` symbol could also be a variable which once resolved 41 | would be multiplied with the result from `twice(foo)`. 42 | 43 | ## Customized Evaluation 44 | 45 | We can also ask the `evaluator` for any unresolved symbols via its ``Evaluator/unresolved`` attribute: 46 | 47 | ```swift 48 | evaluator?.unresolved.unaryFunctions // => ['power']' 49 | ``` 50 | 51 | Supply addition variable and methods to the evaluator's 52 | ``Evaluator/eval(variables:unaryFunctions:binaryFunctions:)`` method. Below, we supply it with a definition for `power`. 53 | 54 | ``` 55 | let myEvalFuncs: [String:(Double)->Double] = ["power": {$0 * $0}] 56 | evaluator?.eval(unaryFunctions: myEvalFuncs.producer) // => 60910.240000000005 57 | ``` 58 | 59 | Just like for the ``MathParser`` initialization method, instead of passing a closure to access the dictionary of 60 | symbols, you can pass the dictionary itself: 61 | 62 | ``` 63 | evaluator?.eval(unaryFunctionDict: myEvalFuncs) // => 60910.240000000005 64 | ``` 65 | -------------------------------------------------------------------------------- /Sources/MathParser/Documentation.docc/GettinStarted.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | Basic math expression parser built with Point•Free's swift-parsing package (v0.12.0). 4 | 5 | ## Usage Example 6 | 7 | ```swift 8 | let parser = MathParser() 9 | let evaluator = parser.parse("4 × sin(t × π) + 2 × sin(t × π)") 10 | evaluator.eval("t", value: 0.0) // => 0.0 11 | evaluator.eval("t", value: 0.25) // => 4.2426406871192848 12 | evaluator.eval("t", value: 0.5) // => 6 13 | evaluator.eval("t", value: 1.0) // => 0 14 | ``` 15 | 16 | The parser will return `nil` if it is unable to completely parse the expression. Alternatively, you can call 17 | ``MathParser/parseResult(_:)`` to obtain a Swift `Result` enum that will have a ``MathParserError`` value when 18 | parsing fails. This will contain a description of the parsing failure that comes from the swift-parsing library. 19 | 20 | ```swift 21 | let evaluator = parser.parseResult("4 × sin(t × π") 22 | print(evaluator) 23 | failure(error: unexpected input 24 | --> input:1:8 25 | 1 | 4 × sin(t × π 26 | | ^ expected end of input) 27 | 28 | ``` 29 | 30 | By default, the expression parser and evaluator handle the following symbols and functions: 31 | 32 | * Standard math operations: addition (`+`), subtraction (`-`), multiplication (`*`), division (`/`), 33 | and exponentiation (`^`) 34 | * The factorial of a number (`!`) 35 | * Constants: `pi` (`π`) and `e` 36 | * 1-argument functions: `sin`, `asin`, `cos`, `acos`, `tan`, `atan`, `log10`, `ln` (`loge`), `log2`, `exp`, `ceil`, 37 | `floor`, `round`, `sqrt` (`√`), `cbrt` (cube root), `abs`, `sgn`, `!` (factorial) 38 | * 2-argument functions: `atan`, `hypot`, `pow` 39 | * alternative math operator symbols: `×` for multiplication and `÷` for division (see example above for use of `×`) 40 | 41 | Note that the factorial operator and function (`!`) only give exact values up to `20!`. They treat all values as 42 | if truncated to an integer before performing the multiplications. Thus, `12.3!` is only `12!`. 43 | 44 | You can reference additional symbols or variables and functions by providing your own mapping functions. There are two 45 | places where this can be done: 46 | 47 | * ``MathParser/init(variables:variableDict:unaryFunctions:unaryFunctionDict:binaryFunctions:binaryFunctionDict:enableImpliedMultiplication:)`` 48 | * ``Evaluator/eval(variables:unaryFunctions:binaryFunctions:)`` 49 | 50 | If a symbol or function does not exist during an `eval` call, the final result will be `NaN`. If a symbol is resolved 51 | during parsing, it will be replaced with the symbol's value, and likewise for any math expressions and function calls 52 | that can be resolved to constant values during the parse. Otherwise, the symbols will be resolved during a future 53 | `eval` call. 54 | 55 | You can get the unresolved symbol names from the ``Evaluator/unresolved`` attribute. It returns three collections for 56 | unresolved variables, unary functions, and binary function names. 57 | 58 | ## Precedence 59 | 60 | The usual math operations follow the traditional precedence hierarchy: multiplication and division operations happen 61 | before addition and subtraction, so `1 + 2 * 3 - 4 / 5 + 6` evaluates the same as `1 + (2 * 3) - (4 / 5) + 6`. 62 | There are three additional operators, one for exponentiations (^) which is higher than the previous ones, 63 | so `2 * 3 ^ 4 + 5` is the same as `2 * (3 ^ 4) + 5`. It is also right-associative, so `2 ^ 3 ^ 4` is evaluated as 64 | `2 ^ (3 ^ 4)` instead of `(2 ^ 3) ^ 4`. 65 | 66 | There are two other operations that are even higher in precedence than exponentiation: 67 | 68 | * negation (`-`) -- `-3.4` 69 | * factorial (`!`) -- `12!` 70 | 71 | Note that factorial of a negative number is undefined, so negation and factorial cannot be combined. In other words, 72 | parsing `-3!` returns `nil`. Also, factorial is only done on the integral portion of a number, so `12.3!` will parse but 73 | the resulting value will be the same as `12!`. In effect, factorial always operates as `floor(x)!` or `!(floor(x))`. 74 | 75 | -------------------------------------------------------------------------------- /Sources/MathParser/Documentation.docc/ImpliedMultiplication.md: -------------------------------------------------------------------------------- 1 | # Implied Multiplication 2 | 3 | Math expression are often written without explicitly indicating when multiplication takes place. Instead there is a 4 | convention that dictates where a multiplication takes place between two terms. 5 | 6 | Often instead of writing `2 * (3 + 4)` one usually writes `2(3 + 4)` with the understanding that `2` is being 7 | multiplied to the value of `3 + 4`. Likewise, it is not uncommon to see numeric values before a function or a constant 8 | such as `π`, so instead of `3 * sin(0.5 * π)` we might see `3sin(0.5π)` or perhaps `3 sin(0.5 π)` to make it a little 9 | easier to read. 10 | 11 | ``MathParser`` supports parsing of math expressions where a multiplication symbol might not be present between two 12 | terms. It is disabled by default, but the 13 | ``MathParser/init(variables:variableDict:unaryFunctions:unaryFunctionDict:binaryFunctions:binaryFunctionDict:enableImpliedMultiplication:)`` 14 | initializer allows it to be enabled via the `enableImpliedMultiplication` parameter. 15 | 16 | ## Space Oddities 17 | 18 | Be aware that with implied multiplication enabled, you could encounter strange parsing if you do not use spaces between 19 | the "-" operator: 20 | 21 | * `2-3` => -6 22 | * `2 -3` -> -6 23 | * `2 - 3` => -1 24 | 25 | However, for "+" all is well: 26 | 27 | * `2+3` => 5 28 | * `2 +3` -> 5 29 | * `2 + 3` => 5 30 | 31 | At the moment, there is no way to handle this ambiguity between implied multiplication, subtraction and negation without 32 | increasing the parsing code just to fix this rare edge-case. So to be safe: 33 | 34 | - do not use implied multiplication, or 35 | - if you do, ensure that your math operators are always surrounded by spaces (the `negation` operator being the 36 | exception as it must always come just before the value it is negating). 37 | 38 | ## Symbol Splitting 39 | 40 | When implied multiplication mode is active and the name of a variable or a 1-parameter (unary) function is not found in 41 | their corresponding map, the token evaluation routine will attempt to resolve them by splitting the names into two or 42 | more pieces that all resolve to known variables and/or functions. For example, using the default variable map and 43 | unary function map from ``MathParser``: 44 | 45 | * `pie` => `pi * e` 46 | * `esin(2π)` => `e * sin(2 * pi)` 47 | * `eeesgn(-1)` => `e * e * e * -1` 48 | 49 | As you can imagine, this could lead to erroneous resolution of variable names and functions, but this behavior is only 50 | used when the initial lookup of the name fails, and it is never performed when the symbol names are separated by a 51 | space. However, if you make a mistake and forget to provide the definition of a custom variable or function, this 52 | special processing could provide a value instead of an error. For instance, consider evaluating `tabs(-3)` where `t` is 53 | a custom variable set to `1.2` and `tabs` is a custom function but it is not provided for in the custom unary function 54 | map: 55 | 56 | * `tabs(-3)` => `1.2 * abs(-3)` => `3.6` 57 | 58 | If implied multiplication had not been active, the evaluator would have correctly reported an issue -- either returning 59 | NaN or a `Result.failure` describing the missing function. 60 | -------------------------------------------------------------------------------- /Sources/MathParser/Double-extension.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 Brad Howes. All rights reserved. 2 | 3 | #if canImport(Darwin) 4 | import Darwin.C 5 | public extension Double { 6 | // swiftlint:disable:next identifier_name 7 | static var e: Self { Darwin.M_E } 8 | } 9 | #elseif canImport(Glibc) 10 | import Glibc 11 | public extension Double { 12 | // swiftlint:disable:next identifier_name 13 | static var e: Self { Glibc.M_E } 14 | } 15 | #else 16 | public extension Double { 17 | static var pi: Self { 3.14159265358979323846264338327950288 } 18 | // swiftlint:disable:next identifier_name 19 | static var e: Self { 2.71828182845904523536028747135266250 } 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /Sources/MathParser/InfixOperation.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Brad Howes. All rights reserved. 2 | 3 | import Parsing 4 | 5 | /** 6 | Parser for left-associative infix operations. Takes a parser for operators to recognize and a parser for values to use 7 | with the operator which could include operations that are of higher precedence than those parsed by the first parser. 8 | 9 | NOTE: this parser will succeed if it can parse at least one operand value. This can be problematic if you want to 10 | have an alternative case for a failed binary expression. 11 | 12 | Based on InfixOperator found in the Arithmetic perf test of https://github.com/pointfreeco/swift-parsing 13 | */ 14 | struct InfixOperation: Parser { 15 | typealias Input = Substring 16 | typealias Output = Token 17 | 18 | private let name: String 19 | private let associativity: Associativity 20 | private let `operator`: any TokenReducerParser 21 | private let operand: any TokenParser 22 | private let impliedOperation: TokenReducer? 23 | public var logging: Bool 24 | 25 | /** 26 | Construct new parser 27 | 28 | - parameter name: the name assigned to the parser 29 | - parameter associativity: determines how operators bind to their operands 30 | - parameter operator: the parser that recognizes valid operators at a certain precedence level 31 | - parameter operand: the parser for values to provide to the operator that may include operations at a higher 32 | precedence level 33 | - parameter impliedOperation: optional ``TokenReducer`` that if present will be used if there is no operator token 34 | */ 35 | @inlinable 36 | init(name: String, 37 | associativity: Associativity, 38 | operator: any TokenReducerParser, 39 | operand: any TokenParser, 40 | implied: TokenReducer? = nil, 41 | logging: Bool = false) { 42 | self.name = name 43 | self.associativity = associativity 44 | self.operator = `operator` 45 | self.operand = operand 46 | self.impliedOperation = implied 47 | self.logging = logging 48 | } 49 | } 50 | 51 | extension InfixOperation { 52 | 53 | /** 54 | Implementation of Parser method. Looks for "operand operator operand" sequences. There is a special case when 55 | `self.implied` is not nil: if two operands follow one another, then the operator from `self.implied` will be used 56 | for the "missing" operator. 57 | 58 | - parameter input: the input stream to parse 59 | - returns: the next output value found in the stream 60 | */ 61 | @inlinable 62 | func parse(_ input: inout Input) throws -> Token { 63 | log("parse", rest: input.prefix(40)) 64 | switch self.associativity { 65 | case .left: 66 | var lhs = try self.operand.parse(&input) 67 | log("got", lhs: lhs) 68 | var rest = input 69 | while true { 70 | if let operation = (try? self.operator.parse(&input)) ?? impliedOperation { 71 | log("got op") 72 | do { 73 | let rhs = try self.operand.parse(&input) 74 | log("got", rhs: rhs) 75 | rest = input 76 | lhs = operation(lhs, rhs) 77 | log("new", lhs: lhs) 78 | continue 79 | } catch { 80 | } 81 | } 82 | // Reset and end parse 83 | input = rest 84 | log("done", rest: rest.prefix(40)) 85 | return lhs 86 | } 87 | case .right: 88 | 89 | // Build up successive right-associative operations in a stack, which are then applied in reverse order using the 90 | // final right-hand operand. 91 | var lhs: [(TokenReducer, Token)] = [] 92 | while true { 93 | let rhs = try self.operand.parse(&input) 94 | do { 95 | let operation = try self.operator.parse(&input) 96 | lhs.append((operation, rhs)) 97 | } catch { 98 | return lhs.reversed().reduce(rhs) { $1.0($1.1, $0) } 99 | } 100 | } 101 | } 102 | } 103 | 104 | // Default action is to print log messages. Test case adapts to check logging is working. 105 | static var logSink: (String) -> Void = { print($0) } 106 | 107 | private func log(_ msg: String, lhs: Token? = nil, rhs: Token? = nil, rest: Substring? = nil) { 108 | guard self.logging else { return } 109 | var msg = "\(name) - \(msg)" 110 | if let lhs = lhs { msg += " lhs: \(lhs)" } 111 | if let rhs = rhs { msg += " rhs: \(rhs)" } 112 | if let rest = rest { msg += " rest: \(rest)" } 113 | Self.logSink(msg) 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Sources/MathParser/MathParserError.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2021 Brad Howes. All rights reserved. 2 | 3 | import Foundation 4 | 5 | /** 6 | Error type that describes a failure in either text parsing or token evaluation. 7 | */ 8 | public enum MathParserError: Error, Equatable { 9 | /// Holds error description from swift-parsing library when parsing fails 10 | case parseFailure(context: String) 11 | /// Holds error when evaluation fails to find a variable 12 | case variableNotFound(name: Substring) 13 | /// Holds error when evaluation fails to find a unary function 14 | case unaryFunctionNotFound(name: Substring) 15 | /// Holds error when evaluation vails to find a binary function 16 | case binaryFunctionNotFound(name: Substring) 17 | } 18 | 19 | extension MathParserError: CustomStringConvertible { 20 | public var description: String { 21 | switch self { 22 | case .parseFailure(let context): return context 23 | case .variableNotFound(let name): return "Variable '\(name)' not found" 24 | case .unaryFunctionNotFound(let name): return "Function '\(name)' not found" 25 | case .binaryFunctionNotFound(let name): return "Function '\(name)' not found" 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/MathParser/Utils.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2023, 2024 Brad Howes. All rights reserved. 2 | 3 | import Foundation 4 | 5 | @inlinable 6 | func factorial(_ value: Double) -> Double { (1...Int(value)).map(Double.init).reduce(1.0, *) } 7 | 8 | @inlinable 9 | func multiply(lhs: Token, rhs: Token) -> Token { Token.reducer(lhs: lhs, rhs: rhs, op: (*), name: "*") } 10 | 11 | @usableFromInline 12 | typealias SplitResult = (token: Token, remaining: Substring) 13 | 14 | @inlinable 15 | func splitIdentifier(_ identifier: Substring, state: EvalState) -> SplitResult? { 16 | if let value = state.findVariable(name: identifier) { 17 | return (token: .constant(value: value), identifier.dropLast(identifier.count)) 18 | } 19 | for count in 1.. SearchResult? { 39 | for count in 0.. Token? { 50 | if let op = searchForUnaryIdentifier(identifier, state: state), 51 | let split = splitIdentifier(identifier.dropLast(op.name.count), state: state) { 52 | if split.remaining.isEmpty { 53 | return multiply(lhs: split.token, rhs: .unaryCall(op: op.op, name: op.name, arg: arg)) 54 | } 55 | return nil 56 | } 57 | 58 | if let split = splitIdentifier(identifier, state: state), 59 | split.remaining.isEmpty { 60 | return multiply(lhs: split.token, rhs: arg) 61 | } 62 | 63 | return nil 64 | } 65 | -------------------------------------------------------------------------------- /Tests/MathParserTests/UtilsTests.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Brad Howes. All rights reserved. 2 | 3 | import XCTest 4 | @testable import MathParser 5 | 6 | final class UtilsTests: XCTestCase { 7 | 8 | let variables = ["a": 3.0, "b": 5.0, "ab": 7.0, "aba": 11.0] 9 | let unaries = ["OO": { $0 * 2.0 }, "FOO": { $0 * 3.0 }] 10 | lazy var state = EvalState(variables: self.variables.producer, unaryFunctions: self.unaries.producer, 11 | binaryFunctions: nil, usingImpliedMultiplication: true) 12 | 13 | override func setUp() {} 14 | 15 | func eval(_ token: Token?) -> Double { 16 | (try? token?.eval(state: state)) ?? .nan 17 | } 18 | 19 | func test_splitIdentifier_fails() { 20 | XCTAssertNil(splitIdentifier("foo", state: state)) 21 | } 22 | 23 | func test_splitIdentifier_findsLargestMatch() { 24 | let result = splitIdentifier("abc", state: state) 25 | XCTAssertEqual(7.0, eval(result!.token)) 26 | XCTAssertEqual("c", String(result!.remaining)) 27 | } 28 | 29 | func test_splitIdentifier_chains() { 30 | let result = splitIdentifier("abaabc", state: state) 31 | XCTAssertEqual(11.0 * 7, eval(result!.token)) 32 | XCTAssertEqual("c", String(result!.remaining)) 33 | } 34 | 35 | func test_splitIdentifier_chainsAndFindsAll() { 36 | let result = splitIdentifier("abaab", state: state) 37 | XCTAssertEqual(11.0 * 7, eval(result!.token)) 38 | XCTAssertEqual("", String(result!.remaining)) 39 | } 40 | 41 | func test_splitIdentifier_chainsLargestMatch() { 42 | let result = splitIdentifier("abaabac", state: state) 43 | XCTAssertEqual(11 * 11, eval(result!.token)) 44 | XCTAssertEqual("c", String(result!.remaining)) 45 | } 46 | 47 | func test_splitIdentifier_chainsRepeatedly() { 48 | let result = splitIdentifier("abaababaaaac", state: state) 49 | XCTAssertEqual(11 * 11 * 5 * 3 * 3 * 3 * 3, eval(result!.token)) 50 | XCTAssertEqual("c", String(result!.remaining)) 51 | } 52 | 53 | func test_searchForUnaryIdentifier_failsWithNil() { 54 | let result = searchForUnaryIdentifier("blah", state: state) 55 | XCTAssertNil(result) 56 | } 57 | 58 | func test_searchForUnaryIdentifier_findsMatch() { 59 | let result = searchForUnaryIdentifier("abcOO", state: state) 60 | XCTAssertEqual("OO", result?.name) 61 | XCTAssertEqual(22, result?.op(11.0)) 62 | } 63 | 64 | func test_searchForUnaryIdentifier_findsLongestMatch() { 65 | let result = searchForUnaryIdentifier("abcFOO", state: state) 66 | XCTAssertEqual("FOO", result?.name) 67 | XCTAssertEqual(33, result?.op(11.0)) 68 | } 69 | 70 | func test_splitUnaryIdentifier_fails() { 71 | XCTAssertNil(splitUnaryIdentifier("D", arg: .constant(value: 13.0), state: state)) 72 | XCTAssertNil(splitUnaryIdentifier("FOOD", arg: .constant(value: 13.0), state: state)) 73 | XCTAssertNil(splitUnaryIdentifier("OOD", arg: .constant(value: 13.0), state: state)) 74 | XCTAssertNil(splitUnaryIdentifier("abcOO", arg: .constant(value: 13.0), state: state)) 75 | } 76 | 77 | func test_splitUnaryIdentifier_matches() { 78 | XCTAssertEqual(7 * 13, eval(splitUnaryIdentifier("ab", arg: .constant(value: 13.0), state: state))) 79 | XCTAssertEqual(3 * 13 * 2, eval(splitUnaryIdentifier("aOO", arg: .constant(value: 13.0), state: state))) 80 | XCTAssertEqual(3 * 13 * 3, eval(splitUnaryIdentifier("aFOO", arg: .constant(value: 13.0), state: state))) 81 | XCTAssertEqual(7 * 13 * 3, eval(splitUnaryIdentifier("abFOO", arg: .constant(value: 13.0), state: state))) 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /docs/css/documentation-topic~topic.fccbd76c.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-f5b28690]{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-f5b28690]{align-items:stretch}.modal-fullscreen .container[data-v-f5b28690]{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-f5b28690]{padding:20px}.modal-standard .container[data-v-f5b28690]{padding:60px;border-radius:var(--border-radius,4px)}@media screen{[data-color-scheme=dark] .modal-standard .container[data-v-f5b28690]{background:#1d1d1f}}@media screen and (prefers-color-scheme:dark){[data-color-scheme=auto] .modal-standard .container[data-v-f5b28690]{background:#1d1d1f}}@media only screen and (max-width:735px){.modal-standard[data-v-f5b28690]{padding:0;align-items:stretch}.modal-standard .container[data-v-f5b28690]{margin:20px 0 0;padding:50px 30px;flex:1;width:100%;border-bottom-left-radius:0;border-bottom-right-radius:0}}.backdrop[data-v-f5b28690]{overflow:auto;background:rgba(0,0,0,.4);-webkit-overflow-scrolling:touch;width:100%;height:100%;position:fixed}.container[data-v-f5b28690]{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-f5b28690]{width:692px}}@media only screen and (max-width:735px){.container[data-v-f5b28690]{width:87.5%}}.close[data-v-f5b28690]{position:absolute;z-index:9999;top:22px;left:22px;width:30px;height:30px;color:#666;cursor:pointer;background:none;border:0;display:flex;align-items:center}.close .close-icon[data-v-f5b28690]{fill:currentColor;width:100%;height:100%}.theme-dark .container[data-v-f5b28690]{background:#000}.theme-dark .container .close[data-v-f5b28690]{color:#b0b0b0}.theme-code .container[data-v-f5b28690]{background-color:var(--background,var(--color-code-background))} -------------------------------------------------------------------------------- /docs/data/documentation/mathparser/mathparsererror/customstringconvertible-implementations.json: -------------------------------------------------------------------------------- 1 | { 2 | "hierarchy" : { 3 | "paths" : [ 4 | [ 5 | "doc:\/\/MathParser\/documentation\/MathParser", 6 | "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError" 7 | ] 8 | ] 9 | }, 10 | "identifier" : { 11 | "interfaceLanguage" : "swift", 12 | "url" : "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError\/CustomStringConvertible-Implementations" 13 | }, 14 | "kind" : "article", 15 | "metadata" : { 16 | "modules" : [ 17 | { 18 | "name" : "MathParser" 19 | } 20 | ], 21 | "role" : "collectionGroup", 22 | "title" : "CustomStringConvertible Implementations" 23 | }, 24 | "schemaVersion" : { 25 | "major" : 0, 26 | "minor" : 3, 27 | "patch" : 0 28 | }, 29 | "sections" : [ 30 | 31 | ], 32 | "topicSections" : [ 33 | { 34 | "generated" : true, 35 | "identifiers" : [ 36 | "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError\/description" 37 | ], 38 | "title" : "Instance Properties" 39 | } 40 | ], 41 | "variants" : [ 42 | { 43 | "paths" : [ 44 | "\/documentation\/mathparser\/mathparsererror\/customstringconvertible-implementations" 45 | ], 46 | "traits" : [ 47 | { 48 | "interfaceLanguage" : "swift" 49 | } 50 | ] 51 | } 52 | ] 53 | , 54 | "references": { 55 | "doc://MathParser/documentation/MathParser": { 56 | "abstract" : [ 57 | 58 | ], 59 | "identifier" : "doc:\/\/MathParser\/documentation\/MathParser", 60 | "kind" : "symbol", 61 | "role" : "collection", 62 | "title" : "MathParser", 63 | "type" : "topic", 64 | "url" : "\/documentation\/mathparser" 65 | }, 66 | "doc://MathParser/documentation/MathParser/MathParserError": { 67 | "abstract" : [ 68 | { 69 | "text" : "Error type that describes a failure in either text parsing or token evaluation.", 70 | "type" : "text" 71 | } 72 | ], 73 | "fragments" : [ 74 | { 75 | "kind" : "keyword", 76 | "text" : "enum" 77 | }, 78 | { 79 | "kind" : "text", 80 | "text" : " " 81 | }, 82 | { 83 | "kind" : "identifier", 84 | "text" : "MathParserError" 85 | } 86 | ], 87 | "identifier" : "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError", 88 | "kind" : "symbol", 89 | "navigatorTitle" : [ 90 | { 91 | "kind" : "identifier", 92 | "text" : "MathParserError" 93 | } 94 | ], 95 | "role" : "symbol", 96 | "title" : "MathParserError", 97 | "type" : "topic", 98 | "url" : "\/documentation\/mathparser\/mathparsererror" 99 | }, 100 | "doc://MathParser/documentation/MathParser/MathParserError/description": { 101 | "abstract" : [ 102 | 103 | ], 104 | "fragments" : [ 105 | { 106 | "kind" : "keyword", 107 | "text" : "var" 108 | }, 109 | { 110 | "kind" : "text", 111 | "text" : " " 112 | }, 113 | { 114 | "kind" : "identifier", 115 | "text" : "description" 116 | }, 117 | { 118 | "kind" : "text", 119 | "text" : ": " 120 | }, 121 | { 122 | "kind" : "typeIdentifier", 123 | "preciseIdentifier" : "s:SS", 124 | "text" : "String" 125 | } 126 | ], 127 | "identifier" : "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError\/description", 128 | "kind" : "symbol", 129 | "role" : "symbol", 130 | "title" : "description", 131 | "type" : "topic", 132 | "url" : "\/documentation\/mathparser\/mathparsererror\/description" 133 | } 134 | } 135 | } -------------------------------------------------------------------------------- /docs/data/documentation/mathparser/mathparsererror/equatable-implementations.json: -------------------------------------------------------------------------------- 1 | { 2 | "hierarchy" : { 3 | "paths" : [ 4 | [ 5 | "doc:\/\/MathParser\/documentation\/MathParser", 6 | "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError" 7 | ] 8 | ] 9 | }, 10 | "identifier" : { 11 | "interfaceLanguage" : "swift", 12 | "url" : "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError\/Equatable-Implementations" 13 | }, 14 | "kind" : "article", 15 | "metadata" : { 16 | "modules" : [ 17 | { 18 | "name" : "MathParser" 19 | } 20 | ], 21 | "role" : "collectionGroup", 22 | "title" : "Equatable Implementations" 23 | }, 24 | "schemaVersion" : { 25 | "major" : 0, 26 | "minor" : 3, 27 | "patch" : 0 28 | }, 29 | "sections" : [ 30 | 31 | ], 32 | "topicSections" : [ 33 | { 34 | "generated" : true, 35 | "identifiers" : [ 36 | "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError\/!=(_:_:)" 37 | ], 38 | "title" : "Operators" 39 | } 40 | ], 41 | "variants" : [ 42 | { 43 | "paths" : [ 44 | "\/documentation\/mathparser\/mathparsererror\/equatable-implementations" 45 | ], 46 | "traits" : [ 47 | { 48 | "interfaceLanguage" : "swift" 49 | } 50 | ] 51 | } 52 | ] 53 | , 54 | "references": { 55 | "doc://MathParser/documentation/MathParser": { 56 | "abstract" : [ 57 | 58 | ], 59 | "identifier" : "doc:\/\/MathParser\/documentation\/MathParser", 60 | "kind" : "symbol", 61 | "role" : "collection", 62 | "title" : "MathParser", 63 | "type" : "topic", 64 | "url" : "\/documentation\/mathparser" 65 | }, 66 | "doc://MathParser/documentation/MathParser/MathParserError": { 67 | "abstract" : [ 68 | { 69 | "text" : "Error type that describes a failure in either text parsing or token evaluation.", 70 | "type" : "text" 71 | } 72 | ], 73 | "fragments" : [ 74 | { 75 | "kind" : "keyword", 76 | "text" : "enum" 77 | }, 78 | { 79 | "kind" : "text", 80 | "text" : " " 81 | }, 82 | { 83 | "kind" : "identifier", 84 | "text" : "MathParserError" 85 | } 86 | ], 87 | "identifier" : "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError", 88 | "kind" : "symbol", 89 | "navigatorTitle" : [ 90 | { 91 | "kind" : "identifier", 92 | "text" : "MathParserError" 93 | } 94 | ], 95 | "role" : "symbol", 96 | "title" : "MathParserError", 97 | "type" : "topic", 98 | "url" : "\/documentation\/mathparser\/mathparsererror" 99 | }, 100 | "doc://MathParser/documentation/MathParser/MathParserError/!=(_:_:)": { 101 | "abstract" : [ 102 | 103 | ], 104 | "fragments" : [ 105 | { 106 | "kind" : "keyword", 107 | "text" : "static" 108 | }, 109 | { 110 | "kind" : "text", 111 | "text" : " " 112 | }, 113 | { 114 | "kind" : "keyword", 115 | "text" : "func" 116 | }, 117 | { 118 | "kind" : "text", 119 | "text" : " " 120 | }, 121 | { 122 | "kind" : "identifier", 123 | "text" : "!=" 124 | }, 125 | { 126 | "kind" : "text", 127 | "text" : " " 128 | }, 129 | { 130 | "kind" : "text", 131 | "text" : "(" 132 | }, 133 | { 134 | "kind" : "typeIdentifier", 135 | "text" : "Self" 136 | }, 137 | { 138 | "kind" : "text", 139 | "text" : ", " 140 | }, 141 | { 142 | "kind" : "typeIdentifier", 143 | "text" : "Self" 144 | }, 145 | { 146 | "kind" : "text", 147 | "text" : ") -> " 148 | }, 149 | { 150 | "kind" : "typeIdentifier", 151 | "preciseIdentifier" : "s:Sb", 152 | "text" : "Bool" 153 | } 154 | ], 155 | "identifier" : "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError\/!=(_:_:)", 156 | "kind" : "symbol", 157 | "role" : "symbol", 158 | "title" : "!=(_:_:)", 159 | "type" : "topic", 160 | "url" : "\/documentation\/mathparser\/mathparsererror\/!=(_:_:)" 161 | } 162 | } 163 | } -------------------------------------------------------------------------------- /docs/data/documentation/mathparser/mathparsererror/error-implementations.json: -------------------------------------------------------------------------------- 1 | { 2 | "hierarchy" : { 3 | "paths" : [ 4 | [ 5 | "doc:\/\/MathParser\/documentation\/MathParser", 6 | "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError" 7 | ] 8 | ] 9 | }, 10 | "identifier" : { 11 | "interfaceLanguage" : "swift", 12 | "url" : "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError\/Error-Implementations" 13 | }, 14 | "kind" : "article", 15 | "metadata" : { 16 | "modules" : [ 17 | { 18 | "name" : "MathParser" 19 | } 20 | ], 21 | "role" : "collectionGroup", 22 | "title" : "Error Implementations" 23 | }, 24 | "schemaVersion" : { 25 | "major" : 0, 26 | "minor" : 3, 27 | "patch" : 0 28 | }, 29 | "sections" : [ 30 | 31 | ], 32 | "topicSections" : [ 33 | { 34 | "generated" : true, 35 | "identifiers" : [ 36 | "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError\/localizedDescription" 37 | ], 38 | "title" : "Instance Properties" 39 | } 40 | ], 41 | "variants" : [ 42 | { 43 | "paths" : [ 44 | "\/documentation\/mathparser\/mathparsererror\/error-implementations" 45 | ], 46 | "traits" : [ 47 | { 48 | "interfaceLanguage" : "swift" 49 | } 50 | ] 51 | } 52 | ] 53 | , 54 | "references": { 55 | "doc://MathParser/documentation/MathParser": { 56 | "abstract" : [ 57 | 58 | ], 59 | "identifier" : "doc:\/\/MathParser\/documentation\/MathParser", 60 | "kind" : "symbol", 61 | "role" : "collection", 62 | "title" : "MathParser", 63 | "type" : "topic", 64 | "url" : "\/documentation\/mathparser" 65 | }, 66 | "doc://MathParser/documentation/MathParser/MathParserError": { 67 | "abstract" : [ 68 | { 69 | "text" : "Error type that describes a failure in either text parsing or token evaluation.", 70 | "type" : "text" 71 | } 72 | ], 73 | "fragments" : [ 74 | { 75 | "kind" : "keyword", 76 | "text" : "enum" 77 | }, 78 | { 79 | "kind" : "text", 80 | "text" : " " 81 | }, 82 | { 83 | "kind" : "identifier", 84 | "text" : "MathParserError" 85 | } 86 | ], 87 | "identifier" : "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError", 88 | "kind" : "symbol", 89 | "navigatorTitle" : [ 90 | { 91 | "kind" : "identifier", 92 | "text" : "MathParserError" 93 | } 94 | ], 95 | "role" : "symbol", 96 | "title" : "MathParserError", 97 | "type" : "topic", 98 | "url" : "\/documentation\/mathparser\/mathparsererror" 99 | }, 100 | "doc://MathParser/documentation/MathParser/MathParserError/localizedDescription": { 101 | "abstract" : [ 102 | 103 | ], 104 | "fragments" : [ 105 | { 106 | "kind" : "keyword", 107 | "text" : "var" 108 | }, 109 | { 110 | "kind" : "text", 111 | "text" : " " 112 | }, 113 | { 114 | "kind" : "identifier", 115 | "text" : "localizedDescription" 116 | }, 117 | { 118 | "kind" : "text", 119 | "text" : ": " 120 | }, 121 | { 122 | "kind" : "typeIdentifier", 123 | "preciseIdentifier" : "s:SS", 124 | "text" : "String" 125 | } 126 | ], 127 | "identifier" : "doc:\/\/MathParser\/documentation\/MathParser\/MathParserError\/localizedDescription", 128 | "kind" : "symbol", 129 | "role" : "symbol", 130 | "title" : "localizedDescription", 131 | "type" : "topic", 132 | "url" : "\/documentation\/mathparser\/mathparsererror\/localizeddescription" 133 | } 134 | } 135 | } -------------------------------------------------------------------------------- /docs/developer-og-twitter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradhowes/swift-math-parser/0b6c6685c2ab102d0fdd3e54f46697d485c4a828/docs/developer-og-twitter.jpg -------------------------------------------------------------------------------- /docs/developer-og.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradhowes/swift-math-parser/0b6c6685c2ab102d0fdd3e54f46697d485c4a828/docs/developer-og.jpg -------------------------------------------------------------------------------- /docs/documentation/mathparser/customsymbols/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/evaluator/eval(_:value:)/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/evaluator/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/evaluator/result/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/evaluator/unresolved/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/evaluator/value/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/gettinstarted/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/impliedmultiplication/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/mathparser/binaryfunction/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/mathparser/binaryfunctionmap/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/mathparser/binaryfunctions/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/mathparser/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/mathparser/parse(_:)/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/mathparser/result/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/mathparser/variabledict/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/mathparser/variablemap/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/mathparser/variables/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/mathparsererror/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/unresolved/count/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/unresolved/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/unresolved/isempty/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/documentation/mathparser/unresolved/variables/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradhowes/swift-math-parser/0b6c6685c2ab102d0fdd3e54f46697d485c4a828/docs/favicon.ico -------------------------------------------------------------------------------- /docs/favicon.svg: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /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/bradhowes/swift-math-parser/0b6c6685c2ab102d0fdd3e54f46697d485c4a828/docs/img/no-image@2x.df2a0a50.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | DocumentationThis page requires JavaScript.Please turn on JavaScript in your browser and refresh the page to view its content. -------------------------------------------------------------------------------- /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:[].concat(w,h,b,[u,{begin:e.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:u,strings:c,keywords:f}}}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-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-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:"",contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,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]?,end:/>/},{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-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-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]+;|[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:/,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[t]},{begin:/'/,end:/'/,contains:[t]},{begin:/[^\s"'=<>`]+/}]}]}]};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:/
Please turn on JavaScript in your browser and refresh the page to view its content.