@@ -127,12 +127,6 @@ struct VariadicsGenerator: ParsableCommand {
127
127
128
128
""" )
129
129
130
- print ( " Generating 'buildBlock(_:)' overloads... " , to: & standardError)
131
- for arity in 1 ..< maxArity {
132
- print ( " Capture arity: \( arity) " , to: & standardError)
133
- emitUnaryBuildBlock ( arity: arity)
134
- }
135
-
136
130
print ( " Generating concatenation overloads... " , to: & standardError)
137
131
for (leftArity, rightArity) in Permutations ( totalArity: maxArity) {
138
132
guard rightArity != 0 else {
@@ -195,21 +189,6 @@ struct VariadicsGenerator: ParsableCommand {
195
189
return " ( \( genericParameters ( ) ) ) "
196
190
}
197
191
198
- func emitUnaryBuildBlock( arity: Int ) {
199
- assert ( arity > 0 )
200
- let captureTypes = ( 0 ..< arity) . map { " C \( $0) " } . joined ( separator: " , " )
201
- output ( """
202
- extension RegexBuilder {
203
- public static func buildBlock<R: RegexProtocol, W, \( captureTypes) >(_ regex: R) -> R
204
- where R.Match == (W, \( captureTypes) )
205
- {
206
- regex
207
- }
208
- }
209
-
210
- """ )
211
- }
212
-
213
192
func emitConcatenation( leftArity: Int , rightArity: Int ) {
214
193
func genericParameters( withConstraints: Bool ) -> String {
215
194
var result = " W0, W1 "
@@ -260,13 +239,12 @@ struct VariadicsGenerator: ParsableCommand {
260
239
// Emit concatenation builder.
261
240
output ( " extension \( patternBuilderTypeName) { \n " )
262
241
output ( """
263
- @_disfavoredOverload
264
- public static func buildBlock< \( genericParameters ( withConstraints: true ) ) >(
265
- combining next: R1, into combined: R0
266
- ) -> \( regexTypeName) < \( matchType) > \( whereClause) {
267
- .init(node: combined.regex.root.appending(next.regex.root))
268
- }
242
+ public static func buildBlock< \( genericParameters ( withConstraints: true ) ) >(
243
+ combining next: R1, into combined: R0
244
+ ) -> \( regexTypeName) < \( matchType) > \( whereClause) {
245
+ .init(node: combined.regex.root.appending(next.regex.root))
269
246
}
247
+ }
270
248
271
249
""" )
272
250
}
@@ -275,7 +253,6 @@ struct VariadicsGenerator: ParsableCommand {
275
253
// T + () = T
276
254
output ( """
277
255
extension RegexBuilder {
278
- @_disfavoredOverload
279
256
public static func buildBlock<W0
280
257
""" )
281
258
outputForEach ( 0 ..< leftArity) {
0 commit comments