swiftlang / swiftlang/swift-experimental-string-processing

SE-0351 was accepted with `mapOutput`, but it's not implemented

Open
#668 4 comments 5 reactions 1 assignee View on GitHub

@milseman is already working on this.

Since May 18, 2023.

Dominant language
Swift
Stars
308
Forks
52
Avg merge
12h 45m
Merged PRs (30d)
2

Description

The proposal for SE-0351 defines a way to map the output of a regex component to reorder captures, flatten nested optionals, or create instances of a custom type. See https://github.com/apple/swift-evolution/blob/main/proposals/0351-regex-builder.md#mapping-output
The proposal was accepted and its status is declared as Implemented (Swift 5.7), but this feature was left out from the compiler.

This is a crucial feature, and I miss it a lot whenever I deal with regexes in Swift. It's not possible to implement it as an extension by external users of the API, because it should have been a builtin component in the DSL tree.

I only found traces of it in the codebase, the PR #455 that implemented it was closed and the follow-up #466 is still in draft.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.