Skip to content

Fix typo and ChoiceOf initializer in DSL pitch. #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Documentation/Evolution/RegexBuilderDSL.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,9 @@ To the developer, the top-level API is a type named `ChoiceOf`. This type has an
```swift
public struct ChoiceOf<Output>: RegexComponent {
public var regex: Regex<Output> { get }
public init(@AlternationBuilder builder: () -> R)
public init<R: RegexComponent>(
@AlternationBuilder builder: () -> R
) where R.Output == Output
}
```

Expand Down Expand Up @@ -1258,7 +1260,7 @@ Sometimes, a textual regex may also use `(?R)` or `(?0)` to recusively evaluate
(you|I) say (goodbye|hello|(?R))
```

For this, `Regex` offers a special initializer that allows its pattern to recursively reference itself. This is somewhat akin to a fixed-pointer combinator.
For this, `Regex` offers a special initializer that allows its pattern to recursively reference itself. This is somewhat akin to a fixed-point combinator.

```swift
extension Regex {
Expand Down