Skip to content

Commit 0f9f0a4

Browse files
authoredMar 17, 2022
Merge pull request #211 from rxwei/dsl-pitch-fix-typo
Fix typo and `ChoiceOf` initializer in DSL pitch.
2 parents 0241228 + f848f58 commit 0f9f0a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎Documentation/Evolution/RegexBuilderDSL.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,9 @@ To the developer, the top-level API is a type named `ChoiceOf`. This type has an
543543
```swift
544544
public struct ChoiceOf<Output>: RegexComponent {
545545
public var regex: Regex<Output> { get }
546-
public init(@AlternationBuilder builder: () -> R)
546+
public init<R: RegexComponent>(
547+
@AlternationBuilder builder: () -> R
548+
) where R.Output == Output
547549
}
548550
```
549551

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

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

12631265
```swift
12641266
extension Regex {

0 commit comments

Comments
 (0)
Please sign in to comment.