@@ -90,7 +90,7 @@ var standardError = StandardErrorStream()
9090
9191typealias Counter = Int64
9292let regexComponentProtocolName = " RegexComponent "
93- let matchAssociatedTypeName = " Match "
93+ let outputAssociatedTypeName = " Output "
9494let patternProtocolRequirementName = " regex "
9595let regexTypeName = " Regex "
9696let baseMatchTypeName = " Substring "
@@ -202,15 +202,15 @@ struct VariadicsGenerator: ParsableCommand {
202202 // Emit concatenation type declaration.
203203
204204 let whereClause : String = {
205- var result = " where R0.Match == "
205+ var result = " where R0. \( outputAssociatedTypeName ) == "
206206 if leftArity == 0 {
207207 result += " W0 "
208208 } else {
209209 result += " (W0 "
210210 result += ( 0 ..< leftArity) . map { " , C \( $0) " } . joined ( )
211211 result += " ) "
212212 }
213- result += " , R1.Match == "
213+ result += " , R1. \( outputAssociatedTypeName ) == "
214214 if rightArity == 0 {
215215 result += " W1 "
216216 } else {
@@ -267,7 +267,7 @@ struct VariadicsGenerator: ParsableCommand {
267267 }
268268 output ( " ) " )
269269 }
270- output ( " > where R0. \( matchAssociatedTypeName ) == " )
270+ output ( " > where R0. \( outputAssociatedTypeName ) == " )
271271 if leftArity == 0 {
272272 output ( " W0 " )
273273 } else {
@@ -348,10 +348,10 @@ struct VariadicsGenerator: ParsableCommand {
348348 self . matchType = arity == 0
349349 ? baseMatchTypeName
350350 : " ( \( baseMatchTypeName) , \( quantifiedCaptures) ) "
351- self . whereClauseForInit = " where \( matchAssociatedTypeName ) == \( matchType) " +
352- ( arity == 0 ? " " : " , Component.Match == (W, \( capturesJoined) ) " )
351+ self . whereClauseForInit = " where \( outputAssociatedTypeName ) == \( matchType) " +
352+ ( arity == 0 ? " " : " , Component. \( outputAssociatedTypeName ) == (W, \( capturesJoined) ) " )
353353 self . whereClause = arity == 0 ? " " :
354- " where Component.Match == (W, \( capturesJoined) ) "
354+ " where Component. \( outputAssociatedTypeName ) == (W, \( capturesJoined) ) "
355355 }
356356 }
357357
@@ -468,10 +468,10 @@ struct VariadicsGenerator: ParsableCommand {
468468 let whereClause : String = {
469469 var result = " where R0: \( regexComponentProtocolName) , R1: \( regexComponentProtocolName) "
470470 if leftArity > 0 {
471- result += " , R0. \( matchAssociatedTypeName ) == (W0, \( ( 0 ..< leftArity) . map { " C \( $0) " } . joined ( separator: " , " ) ) ) "
471+ result += " , R0. \( outputAssociatedTypeName ) == (W0, \( ( 0 ..< leftArity) . map { " C \( $0) " } . joined ( separator: " , " ) ) ) "
472472 }
473473 if rightArity > 0 {
474- result += " , R1. \( matchAssociatedTypeName ) == (W1, \( ( leftArity..< leftArity+ rightArity) . map { " C \( $0) " } . joined ( separator: " , " ) ) ) "
474+ result += " , R1. \( outputAssociatedTypeName ) == (W1, \( ( leftArity..< leftArity+ rightArity) . map { " C \( $0) " } . joined ( separator: " , " ) ) ) "
475475 }
476476 return result
477477 } ( )
@@ -516,7 +516,7 @@ struct VariadicsGenerator: ParsableCommand {
516516 } ( )
517517 let whereClause : String = """
518518 where R: \( regexComponentProtocolName) , \
519- R. \( matchAssociatedTypeName ) == (W, \( captures) )
519+ R. \( outputAssociatedTypeName ) == (W, \( captures) )
520520 """
521521 let resultCaptures = ( 0 ..< arity) . map { " C \( $0) ? " } . joined ( separator: " , " )
522522 output ( """
@@ -544,8 +544,8 @@ struct VariadicsGenerator: ParsableCommand {
544544 }
545545 let rawNewMatchType = newMatchType ( newCaptureType: " W " )
546546 let transformedNewMatchType = newMatchType ( newCaptureType: " NewCapture " )
547- let whereClauseRaw = " where \( matchAssociatedTypeName ) == \( rawNewMatchType) , R. \( matchAssociatedTypeName ) == \( matchType) "
548- let whereClauseTransformed = " where \( matchAssociatedTypeName ) == \( transformedNewMatchType) , R. \( matchAssociatedTypeName ) == \( matchType) "
547+ let whereClauseRaw = " where \( outputAssociatedTypeName ) == \( rawNewMatchType) , R. \( outputAssociatedTypeName ) == \( matchType) "
548+ let whereClauseTransformed = " where \( outputAssociatedTypeName ) == \( transformedNewMatchType) , R. \( outputAssociatedTypeName ) == \( matchType) "
549549 output ( """
550550 // MARK: - Non-builder capture arity \( arity)
551551
0 commit comments