{"id":13078778,"url":"https://github.com/swiftlang/swift-experimental-string-processing","last_synced_at":"2025-05-16T06:00:21.219Z","repository":{"id":36989433,"uuid":"410140421","full_name":"swiftlang/swift-experimental-string-processing","owner":"swiftlang","description":"An early experimental general-purpose pattern matching engine for Swift.","archived":false,"fork":false,"pushed_at":"2025-04-14T06:23:23.000Z","size":5604,"stargazers_count":285,"open_issues_count":82,"forks_count":49,"subscribers_count":117,"default_branch":"main","last_synced_at":"2025-04-19T10:17:16.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swiftlang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-25T00:55:05.000Z","updated_at":"2025-04-19T07:03:11.000Z","dependencies_parsed_at":"2024-02-13T23:21:59.159Z","dependency_job_id":"af57c3a2-a642-4f0b-a9b9-bc3e15075dc1","html_url":"https://github.com/swiftlang/swift-experimental-string-processing","commit_stats":null,"previous_names":["swiftlang/swift-experimental-string-processing","apple/swift-experimental-string-processing"],"tags_count":685,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftlang%2Fswift-experimental-string-processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftlang%2Fswift-experimental-string-processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftlang%2Fswift-experimental-string-processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftlang%2Fswift-experimental-string-processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftlang","download_url":"https://codeload.github.com/swiftlang/swift-experimental-string-processing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478160,"owners_count":22077675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-25T02:11:22.566Z","updated_at":"2025-05-16T06:00:19.407Z","avatar_url":"https://github.com/swiftlang.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Declarative String Processing for Swift\n\nAn early experimental general-purpose pattern matching engine for Swift.\n\nSee [Declarative String Processing Overview][decl-string]\n\n[decl-string]: Documentation/DeclarativeStringProcessing.md\n\n## Requirements\n\n- [Swift Trunk Development Snapshot](https://www.swift.org/download/#snapshots) DEVELOPMENT-SNAPSHOT-2022-04-20 or later.\n\n## Trying it out\n\nTo try out the functionality provided here, download the latest open source development toolchain. Import `_StringProcessing` in your source file to get access to the API and specify `-Xfrontend -enable-experimental-string-processing` to get access to the literals.\n\nFor example, in a `Package.swift` file's target declaration:\n\n```swift\n.target(\n    name: \"foo\",\n    dependencies: [\"depA\"],\n    swiftSettings: [.unsafeFlags([\"-Xfrontend\", \"-enable-experimental-string-processing\"])]\n ),\n```\n\n\n## Integration with Swift\n\n`_RegexParser` and `_StringProcessing` are specially integrated modules that are built as part of apple/swift.\n\nSpecifically, `_RegexParser` contains the parser for regular expression literals and is built both as part of the compiler and as a core library. `_CUnicode` and `_StringProcessing` are built together as a core library named `_StringProcessing`.\n\n| Module              | Swift toolchain component                                                            |\n| ------------------- | ------------------------------------------------------------------------------------ |\n| `_RegexParser`      | `SwiftCompilerSources/Sources/_RegexParser` and `stdlib/public/_RegexParser` |\n| `_CUnicode`         | `stdlib/public/_StringProcessing`                                                    |\n| `_StringProcessing` | `stdlib/public/_StringProcessing`                                                    |\n\n### Branching scheme\n\n#### Development branch\n\nThe `main` branch is the branch for day-to-day development. Generally, you should create PRs against this branch.\n\n#### Swift integration branches\n\nBranches whose name starts with `swift/` are Swift integration branches similar to those in [apple/llvm-project](https://github.com/apple/llvm-project). For each branch, dropping the `swift/` prefix is the corresponding branch in [apple/swift](https://github.com/apple/swift).\n\n| apple/swift branch  | apple/swift-experimental-string-processing branch     |\n| ------------------- | ----------------------------------------------------- |\n| main                | swift/main                                            |\n| release/5.7         | swift/release/5.7                                     |\n| ...                 | swift/...                                             |\n\nA pair of corresponding branches are expected to build successfully together and pass all tests.\n\n### Integration workflow\n\nTo integrate the latest changes in apple/swift-experimental-string-processing to apple/swift, carefully follow the workflow: \n\n- Create pull requests.\n  - Create a branch from a commit on `main` that you would like to integrate into `swift/main`.\n  - Create a pull request in apple/swift-experimental-string-processing from that branch to `swift/main`, e.g. \"[Integration] main (\u003ccommit\u003e) -\u003e swift/main\".\n  - If apple/swift needs to be modified to work with the latest `main` in apple/swift-experimental-string-processing, create a pull request in apple/swift.  **Note:** Since CI in apple/swift-experimental-string-processing has not yet been set up to run full toolchain tests, you should create a PR in apple/swift regardless; if the integartion does not require changing apple/swift, create a dummy PR in apple/swift by changing the README and just not merge it in the end.\n- Trigger CI.\n  - In the apple/swift-experimental-string-processing pull request, trigger CI using the following command (replacing `\u003cPR NUMBER\u003e` with the apple/swift pull request number, if any):\n    ```\n    apple/swift#\u003cPR NUMBER\u003e # use this line only if there is an corresponding apple/swift PR\n    @swift-ci please test\n    ```\n  - In the apple/swift pull request (if any), trigger CI using the following command (replacing `\u003cPR NUMBER\u003e` with the apple/swift-experimental-string-processing pull request number):\n    ```\n    apple/swift-experimental-string-processing#\u003cPR NUMBER\u003e\n    @swift-ci please test\n    ```\n- Merge when approved.\n  - Merge the pull request in apple/swift-experimental-string-processing as a **merge commit**.\n  - Merge the pull request in apple/swift (if any).\n\n### Development notes\n\nCompiler integration can be tricky. Use special caution when developing `_RegexParser` and `_StringProcessing` modules.\n\n- Do not change the names of these modules without due approval from compiler and infrastructure teams.\n- Do not modify the existing ABI (e.g. C API, serialization format) between the regular expression parser and the Swift compiler unless absolutely necessary. \n- Always minimize the number of lockstep integrations, i.e. when apple/swift-experimental-string-processing and apple/swift have to change together. Whenever possible, introduce new API first, migrate Swift compiler onto it, and then deprecate old API. Use versioning if helpful.\n- In `_StringProcessing`, do not write fully qualified references to symbols in `_CUnicode`, and always wrap `import _CUnicode` in a `#if canImport(_CUnicode)`. This is because `_CUnicode` is built as part of `_StringProcessing` with CMake.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftlang%2Fswift-experimental-string-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftlang%2Fswift-experimental-string-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftlang%2Fswift-experimental-string-processing/lists"}