From db24c1c28e26d265daa32382e0f97d4dba0374f2 Mon Sep 17 00:00:00 2001 From: Richard Wei Date: Fri, 4 Mar 2022 01:09:32 -0800 Subject: [PATCH] Rename 'RegexProtocol' to 'RegexComponent' and `RegexBuilder` to `RegexComponentBuilder`. We've decided to use `RegexComponent` for the protocol, and use `RegexComponentBuilder` for the builder type since we want the user to import a module named `RegexBuilder` to get the DSL. --- .../Participants/RegexParticipant.swift | 2 +- Sources/Prototypes/TourOfTypes/Literal.swift | 22 +- .../VariadicsGenerator.swift | 47 +- .../Algorithms/Algorithms/Contains.swift | 2 +- .../Algorithms/Algorithms/FirstRange.swift | 4 +- .../Algorithms/Algorithms/Ranges.swift | 4 +- .../Algorithms/Algorithms/Replace.swift | 6 +- .../Algorithms/Algorithms/Split.swift | 4 +- .../Algorithms/Algorithms/StartsWith.swift | 4 +- .../Algorithms/Algorithms/Trim.swift | 18 +- .../Algorithms/Consumers/RegexConsumer.swift | 2 +- .../Algorithms/Matching/FirstMatch.swift | 4 +- .../Algorithms/Matching/MatchReplace.swift | 6 +- .../Algorithms/Matching/Matches.swift | 4 +- .../_StringProcessing/CharacterClass.swift | 2 +- .../_StringProcessing/RegexDSL/Anchor.swift | 8 +- .../_StringProcessing/RegexDSL/Builder.swift | 10 +- Sources/_StringProcessing/RegexDSL/Core.swift | 12 +- Sources/_StringProcessing/RegexDSL/DSL.swift | 40 +- .../RegexDSL/DSLConsumers.swift | 2 +- .../_StringProcessing/RegexDSL/Match.swift | 14 +- .../_StringProcessing/RegexDSL/Options.swift | 2 +- .../RegexDSL/Variadics.swift | 1338 ++++++++--------- Tests/RegexTests/AlgorithmsTests.swift | 2 +- Tests/RegexTests/RegexDSLTests.swift | 4 +- 25 files changed, 782 insertions(+), 781 deletions(-) diff --git a/Sources/Exercises/Participants/RegexParticipant.swift b/Sources/Exercises/Participants/RegexParticipant.swift index 635e0bcf9..e44246b80 100644 --- a/Sources/Exercises/Participants/RegexParticipant.swift +++ b/Sources/Exercises/Participants/RegexParticipant.swift @@ -58,7 +58,7 @@ private func extractFromCaptures( } @inline(__always) // get rid of generic please -private func graphemeBreakPropertyData( +private func graphemeBreakPropertyData( forLine line: String, using regex: RP ) -> GraphemeBreakEntry? where RP.Match == (Substring, Substring, Substring?, Substring) { diff --git a/Sources/Prototypes/TourOfTypes/Literal.swift b/Sources/Prototypes/TourOfTypes/Literal.swift index 17b95856b..e5cec19a1 100644 --- a/Sources/Prototypes/TourOfTypes/Literal.swift +++ b/Sources/Prototypes/TourOfTypes/Literal.swift @@ -55,16 +55,16 @@ enum SemanticsLevel { } /// Conformers can be ran as a regex / pattern -protocol RegexProtocol { +protocol RegexComponent { var level: SemanticsLevel? { get } } /// Provide the option to encode semantic level statically protocol RegexLiteralProtocol: ExpressibleByRegexLiteral { - associatedtype ScalarSemanticRegex: RegexProtocol - associatedtype GraphemeSemanticRegex: RegexProtocol - associatedtype POSIXSemanticRegex: RegexProtocol - associatedtype UnspecifiedSemanticRegex: RegexProtocol = RegexLiteral + associatedtype ScalarSemanticRegex: RegexComponent + associatedtype GraphemeSemanticRegex: RegexComponent + associatedtype POSIXSemanticRegex: RegexComponent + associatedtype UnspecifiedSemanticRegex: RegexComponent = RegexLiteral var scalarSemantic: ScalarSemanticRegex { get } var graphemeSemantic: GraphemeSemanticRegex { get } @@ -84,16 +84,16 @@ struct StaticSemanticRegexLiteral: RegexLiteralProtocol { */ /// A regex that has statically bound its semantic level - struct ScalarSemanticRegex: RegexProtocol { + struct ScalarSemanticRegex: RegexComponent { var level: SemanticsLevel? { .scalar } } - struct GraphemeSemanticRegex: RegexProtocol { + struct GraphemeSemanticRegex: RegexComponent { var level: SemanticsLevel? { .graphemeCluster } } - struct POSIXSemanticRegex: RegexProtocol { + struct POSIXSemanticRegex: RegexComponent { var level: SemanticsLevel? { .posix } } - struct UnspecifiedSemanticRegex: RegexProtocol { + struct UnspecifiedSemanticRegex: RegexComponent { var level: SemanticsLevel? { nil } } @@ -132,9 +132,9 @@ struct RegexLiteral: ExpressibleByRegexLiteral { } } -extension RegexLiteral: RegexProtocol, RegexLiteralProtocol { +extension RegexLiteral: RegexComponent, RegexLiteralProtocol { /// A regex that has finally bound its semantic level (dynamically) - struct BoundSemantic: RegexProtocol { + struct BoundSemantic: RegexComponent { var _level: SemanticsLevel // Bound semantic level var level: SemanticsLevel? { _level } } diff --git a/Sources/VariadicsGenerator/VariadicsGenerator.swift b/Sources/VariadicsGenerator/VariadicsGenerator.swift index 312ea9a97..21e3cf666 100644 --- a/Sources/VariadicsGenerator/VariadicsGenerator.swift +++ b/Sources/VariadicsGenerator/VariadicsGenerator.swift @@ -89,12 +89,13 @@ struct StandardErrorStream: TextOutputStream { var standardError = StandardErrorStream() typealias Counter = Int64 -let regexProtocolName = "RegexProtocol" +let regexComponentProtocolName = "RegexComponent" let matchAssociatedTypeName = "Match" -let patternBuilderTypeName = "RegexBuilder" let patternProtocolRequirementName = "regex" let regexTypeName = "Regex" let baseMatchTypeName = "Substring" +let concatBuilderName = "RegexComponentBuilder" +let altBuilderName = "AlternationBuilder" @main struct VariadicsGenerator: ParsableCommand { @@ -194,7 +195,7 @@ struct VariadicsGenerator: ParsableCommand { result += (0..( combining next: R1, into combined: R0 @@ -246,14 +247,14 @@ struct VariadicsGenerator: ParsableCommand { func emitConcatenationWithEmpty(leftArity: Int) { // T + () = T output(""" - extension RegexBuilder { + extension \(concatBuilderName) { public static func buildBlock( + , R0: \(regexComponentProtocolName), R1: \(regexComponentProtocolName)>( combining next: R1, into combined: R0 ) -> \(regexTypeName)< """) @@ -329,7 +330,7 @@ struct VariadicsGenerator: ParsableCommand { result += (0..( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @\(concatBuilderName) _ component: () -> Component ) -> \(regexTypeName)<\(params.matchType)> \(params.whereClause) { .init(node: .quantification(.\(kind.astQuantifierAmount), behavior.astKind, component().regex.root)) } @@ -380,7 +381,7 @@ struct VariadicsGenerator: ParsableCommand { \(kind == .zeroOrOne ? """ - extension RegexBuilder { + extension \(concatBuilderName) { public static func buildLimitedAvailability<\(params.genericParams)>( _ component: Component ) -> \(regexTypeName)<\(params.matchType)> \(params.whereClause) { @@ -413,7 +414,7 @@ struct VariadicsGenerator: ParsableCommand { \(params.disfavored)\ public func repeating<\(params.genericParams)>( count: Int, - @RegexBuilder _ component: () -> Component + @\(concatBuilderName) _ component: () -> Component ) -> \(regexTypeName)<\(params.matchType)> \(params.whereClause) { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` @@ -433,7 +434,7 @@ struct VariadicsGenerator: ParsableCommand { public func repeating<\(params.genericParams), R: RangeExpression>( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @\(concatBuilderName) _ component: () -> Component ) -> \(regexTypeName)<\(params.matchType)> \(params.repeatingWhereClause) { .init(node: .repeating(expression.relative(to: 0.. 0 { result += ", R0.\(matchAssociatedTypeName) == (W0, \((0..( combining next: R1, into combined: R0 ) -> \(regexTypeName)<\(matchType)> \(whereClause) { @@ -505,12 +506,12 @@ struct VariadicsGenerator: ParsableCommand { return "R, W, " + captures }() let whereClause: String = """ - where R: \(regexProtocolName), \ + where R: \(regexComponentProtocolName), \ R.\(matchAssociatedTypeName) == (W, \(captures)) """ let resultCaptures = (0..(_ regex: R) -> \(regexTypeName)<(W, \(resultCaptures))> \(whereClause) { .init(node: .alternation([regex.regex.root])) } @@ -521,8 +522,8 @@ struct VariadicsGenerator: ParsableCommand { func emitCapture(arity: Int) { let genericParams = arity == 0 - ? "R: \(regexProtocolName), W" - : "R: \(regexProtocolName), W, " + (0..( - @RegexBuilder _ component: () -> R + @\(concatBuilderName) _ component: () -> R ) -> \(regexTypeName)<\(rawNewMatchType)> \(whereClause) { .init(node: .group(.capture, component().regex.root)) } public func capture<\(genericParams)>( as reference: Reference, - @RegexBuilder _ component: () -> R + @\(concatBuilderName) _ component: () -> R ) -> \(regexTypeName)<\(rawNewMatchType)> \(whereClause) { .init(node: .group(.capture, component().regex.root, reference.id)) } public func capture<\(genericParams), NewCapture>( - @RegexBuilder _ component: () -> R, + @\(concatBuilderName) _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> \(regexTypeName)<\(transformedNewMatchType)> \(whereClause) { .init(node: .groupTransform( @@ -656,7 +657,7 @@ struct VariadicsGenerator: ParsableCommand { public func tryCapture<\(genericParams), NewCapture>( as reference: Reference, - @RegexBuilder _ component: () -> R, + @\(concatBuilderName) _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> \(regexTypeName)<\(transformedNewMatchType)> \(whereClause) { .init(node: .groupTransform( @@ -669,7 +670,7 @@ struct VariadicsGenerator: ParsableCommand { } public func tryCapture<\(genericParams), NewCapture>( - @RegexBuilder _ component: () -> R, + @\(concatBuilderName) _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> \(regexTypeName)<\(transformedNewMatchType)> \(whereClause) { .init(node: .groupTransform( @@ -682,7 +683,7 @@ struct VariadicsGenerator: ParsableCommand { public func tryCapture<\(genericParams), NewCapture>( as reference: Reference, - @RegexBuilder _ component: () -> R, + @\(concatBuilderName) _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> \(regexTypeName)<\(transformedNewMatchType)> \(whereClause) { .init(node: .groupTransform( diff --git a/Sources/_StringProcessing/Algorithms/Algorithms/Contains.swift b/Sources/_StringProcessing/Algorithms/Algorithms/Contains.swift index 03e2c53ee..dbe7923ec 100644 --- a/Sources/_StringProcessing/Algorithms/Algorithms/Contains.swift +++ b/Sources/_StringProcessing/Algorithms/Algorithms/Contains.swift @@ -40,7 +40,7 @@ extension BidirectionalCollection where Element: Comparable { // MARK: Regex algorithms extension BidirectionalCollection where SubSequence == Substring { - public func contains(_ regex: R) -> Bool { + public func contains(_ regex: R) -> Bool { contains(RegexConsumer(regex)) } } diff --git a/Sources/_StringProcessing/Algorithms/Algorithms/FirstRange.swift b/Sources/_StringProcessing/Algorithms/Algorithms/FirstRange.swift index 64a5eb943..40d5b9950 100644 --- a/Sources/_StringProcessing/Algorithms/Algorithms/FirstRange.swift +++ b/Sources/_StringProcessing/Algorithms/Algorithms/FirstRange.swift @@ -56,11 +56,11 @@ extension BidirectionalCollection where Element: Comparable { // MARK: Regex algorithms extension BidirectionalCollection where SubSequence == Substring { - public func firstRange(of regex: R) -> Range? { + public func firstRange(of regex: R) -> Range? { firstRange(of: RegexConsumer(regex)) } - public func lastRange(of regex: R) -> Range? { + public func lastRange(of regex: R) -> Range? { lastRange(of: RegexConsumer(regex)) } } diff --git a/Sources/_StringProcessing/Algorithms/Algorithms/Ranges.swift b/Sources/_StringProcessing/Algorithms/Algorithms/Ranges.swift index aefdbce3f..e56e35e72 100644 --- a/Sources/_StringProcessing/Algorithms/Algorithms/Ranges.swift +++ b/Sources/_StringProcessing/Algorithms/Algorithms/Ranges.swift @@ -216,13 +216,13 @@ extension BidirectionalCollection where Element: Comparable { // MARK: Regex algorithms extension BidirectionalCollection where SubSequence == Substring { - public func ranges( + public func ranges( of regex: R ) -> RangesCollection> { ranges(of: RegexConsumer(regex)) } - public func rangesFromBack( + public func rangesFromBack( of regex: R ) -> ReversedRangesCollection> { rangesFromBack(of: RegexConsumer(regex)) diff --git a/Sources/_StringProcessing/Algorithms/Algorithms/Replace.swift b/Sources/_StringProcessing/Algorithms/Algorithms/Replace.swift index 36a28b381..e2c9d78a4 100644 --- a/Sources/_StringProcessing/Algorithms/Algorithms/Replace.swift +++ b/Sources/_StringProcessing/Algorithms/Algorithms/Replace.swift @@ -149,7 +149,7 @@ extension RangeReplaceableCollection // MARK: Regex algorithms extension RangeReplaceableCollection where SubSequence == Substring { - public func replacing( + public func replacing( _ regex: R, with replacement: Replacement, subrange: Range, @@ -162,7 +162,7 @@ extension RangeReplaceableCollection where SubSequence == Substring { maxReplacements: maxReplacements) } - public func replacing( + public func replacing( _ regex: R, with replacement: Replacement, maxReplacements: Int = .max @@ -174,7 +174,7 @@ extension RangeReplaceableCollection where SubSequence == Substring { maxReplacements: maxReplacements) } - public mutating func replace( + public mutating func replace( _ regex: R, with replacement: Replacement, maxReplacements: Int = .max diff --git a/Sources/_StringProcessing/Algorithms/Algorithms/Split.swift b/Sources/_StringProcessing/Algorithms/Algorithms/Split.swift index ba2cda30b..15c946ca2 100644 --- a/Sources/_StringProcessing/Algorithms/Algorithms/Split.swift +++ b/Sources/_StringProcessing/Algorithms/Algorithms/Split.swift @@ -275,13 +275,13 @@ extension BidirectionalCollection where Element: Comparable { // MARK: Regex algorithms extension BidirectionalCollection where SubSequence == Substring { - public func split( + public func split( by separator: R ) -> SplitCollection> { split(by: RegexConsumer(separator)) } - public func splitFromBack( + public func splitFromBack( by separator: R ) -> ReversedSplitCollection> { splitFromBack(by: RegexConsumer(separator)) diff --git a/Sources/_StringProcessing/Algorithms/Algorithms/StartsWith.swift b/Sources/_StringProcessing/Algorithms/Algorithms/StartsWith.swift index ee9432fb4..75c6e1133 100644 --- a/Sources/_StringProcessing/Algorithms/Algorithms/StartsWith.swift +++ b/Sources/_StringProcessing/Algorithms/Algorithms/StartsWith.swift @@ -48,11 +48,11 @@ extension BidirectionalCollection where Element: Equatable { // MARK: Regex algorithms extension BidirectionalCollection where SubSequence == Substring { - public func starts(with regex: R) -> Bool { + public func starts(with regex: R) -> Bool { starts(with: RegexConsumer(regex)) } - public func ends(with regex: R) -> Bool { + public func ends(with regex: R) -> Bool { ends(with: RegexConsumer(regex)) } } diff --git a/Sources/_StringProcessing/Algorithms/Algorithms/Trim.swift b/Sources/_StringProcessing/Algorithms/Algorithms/Trim.swift index b2438bb3b..65a71e1b7 100644 --- a/Sources/_StringProcessing/Algorithms/Algorithms/Trim.swift +++ b/Sources/_StringProcessing/Algorithms/Algorithms/Trim.swift @@ -257,15 +257,15 @@ extension RangeReplaceableCollection // MARK: Regex algorithms extension BidirectionalCollection where SubSequence == Substring { - public func trimmingPrefix(_ regex: R) -> SubSequence { + public func trimmingPrefix(_ regex: R) -> SubSequence { trimmingPrefix(RegexConsumer(regex)) } - public func trimmingSuffix(_ regex: R) -> SubSequence { + public func trimmingSuffix(_ regex: R) -> SubSequence { trimmingSuffix(RegexConsumer(regex)) } - public func trimming(_ regex: R) -> SubSequence { + public func trimming(_ regex: R) -> SubSequence { trimming(RegexConsumer(regex)) } } @@ -273,15 +273,15 @@ extension BidirectionalCollection where SubSequence == Substring { extension RangeReplaceableCollection where Self: BidirectionalCollection, SubSequence == Substring { - public mutating func trimPrefix(_ regex: R) { + public mutating func trimPrefix(_ regex: R) { trimPrefix(RegexConsumer(regex)) } - public mutating func trimSuffix(_ regex: R) { + public mutating func trimSuffix(_ regex: R) { trimSuffix(RegexConsumer(regex)) } - public mutating func trim(_ regex: R) { + public mutating func trim(_ regex: R) { let consumer = RegexConsumer(regex) trimPrefix(consumer) trimSuffix(consumer) @@ -289,15 +289,15 @@ extension RangeReplaceableCollection } extension Substring { - public mutating func trimPrefix(_ regex: R) { + public mutating func trimPrefix(_ regex: R) { trimPrefix(RegexConsumer(regex)) } - public mutating func trimSuffix(_ regex: R) { + public mutating func trimSuffix(_ regex: R) { trimSuffix(RegexConsumer(regex)) } - public mutating func trim(_ regex: R) { + public mutating func trim(_ regex: R) { let consumer = RegexConsumer(regex) trimPrefix(consumer) trimSuffix(consumer) diff --git a/Sources/_StringProcessing/Algorithms/Consumers/RegexConsumer.swift b/Sources/_StringProcessing/Algorithms/Consumers/RegexConsumer.swift index 5af689cbc..331246d0e 100644 --- a/Sources/_StringProcessing/Algorithms/Consumers/RegexConsumer.swift +++ b/Sources/_StringProcessing/Algorithms/Consumers/RegexConsumer.swift @@ -10,7 +10,7 @@ //===----------------------------------------------------------------------===// public struct RegexConsumer< - R: RegexProtocol, Consumed: BidirectionalCollection + R: RegexComponent, Consumed: BidirectionalCollection > where Consumed.SubSequence == Substring { // TODO: Should `Regex` itself implement these protocols? let regex: R diff --git a/Sources/_StringProcessing/Algorithms/Matching/FirstMatch.swift b/Sources/_StringProcessing/Algorithms/Matching/FirstMatch.swift index 91d33e123..c0699b805 100644 --- a/Sources/_StringProcessing/Algorithms/Matching/FirstMatch.swift +++ b/Sources/_StringProcessing/Algorithms/Matching/FirstMatch.swift @@ -38,13 +38,13 @@ extension BidirectionalCollection { // MARK: Regex algorithms extension BidirectionalCollection where SubSequence == Substring { - public func firstMatch( + public func firstMatch( of regex: R ) -> _MatchResult>? { firstMatch(of: RegexConsumer(regex)) } - public func lastMatch( + public func lastMatch( of regex: R ) -> _BackwardMatchResult>? { lastMatch(of: RegexConsumer(regex)) diff --git a/Sources/_StringProcessing/Algorithms/Matching/MatchReplace.swift b/Sources/_StringProcessing/Algorithms/Matching/MatchReplace.swift index 2feb09df0..f99e525b5 100644 --- a/Sources/_StringProcessing/Algorithms/Matching/MatchReplace.swift +++ b/Sources/_StringProcessing/Algorithms/Matching/MatchReplace.swift @@ -75,7 +75,7 @@ extension RangeReplaceableCollection { // MARK: Regex algorithms extension RangeReplaceableCollection where SubSequence == Substring { - public func replacing( + public func replacing( _ regex: R, with replacement: (_MatchResult>) throws -> Replacement, subrange: Range, @@ -88,7 +88,7 @@ extension RangeReplaceableCollection where SubSequence == Substring { maxReplacements: maxReplacements) } - public func replacing( + public func replacing( _ regex: R, with replacement: (_MatchResult>) throws -> Replacement, maxReplacements: Int = .max @@ -100,7 +100,7 @@ extension RangeReplaceableCollection where SubSequence == Substring { maxReplacements: maxReplacements) } - public mutating func replace( + public mutating func replace( _ regex: R, with replacement: (_MatchResult>) throws -> Replacement, maxReplacements: Int = .max diff --git a/Sources/_StringProcessing/Algorithms/Matching/Matches.swift b/Sources/_StringProcessing/Algorithms/Matching/Matches.swift index f92c353ea..1e4dae113 100644 --- a/Sources/_StringProcessing/Algorithms/Matching/Matches.swift +++ b/Sources/_StringProcessing/Algorithms/Matching/Matches.swift @@ -184,13 +184,13 @@ extension BidirectionalCollection { // MARK: Regex algorithms extension BidirectionalCollection where SubSequence == Substring { - public func matches( + public func matches( of regex: R ) -> MatchesCollection> { matches(of: RegexConsumer(regex)) } - public func matchesFromBack( + public func matchesFromBack( of regex: R ) -> ReversedMatchesCollection> { matchesFromBack(of: RegexConsumer(regex)) diff --git a/Sources/_StringProcessing/CharacterClass.swift b/Sources/_StringProcessing/CharacterClass.swift index 124669a43..d72ecf06c 100644 --- a/Sources/_StringProcessing/CharacterClass.swift +++ b/Sources/_StringProcessing/CharacterClass.swift @@ -178,7 +178,7 @@ public struct CharacterClass: Hashable { } } -extension RegexProtocol where Self == CharacterClass { +extension RegexComponent where Self == CharacterClass { public static var any: CharacterClass { .init(cc: .any, matchLevel: .graphemeCluster) } diff --git a/Sources/_StringProcessing/RegexDSL/Anchor.swift b/Sources/_StringProcessing/RegexDSL/Anchor.swift index 1db481ee0..da3452d5c 100644 --- a/Sources/_StringProcessing/RegexDSL/Anchor.swift +++ b/Sources/_StringProcessing/RegexDSL/Anchor.swift @@ -27,7 +27,7 @@ public struct Anchor { var isInverted: Bool = false } -extension Anchor: RegexProtocol { +extension Anchor: RegexComponent { var astAssertion: AST.Atom.AssertionKind { if !isInverted { switch kind { @@ -106,14 +106,14 @@ extension Anchor { } } -public func lookahead( +public func lookahead( negative: Bool = false, - @RegexBuilder _ content: () -> R + @RegexComponentBuilder _ content: () -> R ) -> Regex { Regex(node: .group(negative ? .negativeLookahead : .lookahead, content().regex.root)) } -public func lookahead( +public func lookahead( _ component: R, negative: Bool = false ) -> Regex { diff --git a/Sources/_StringProcessing/RegexDSL/Builder.swift b/Sources/_StringProcessing/RegexDSL/Builder.swift index f4b3516c3..68ec3fe32 100644 --- a/Sources/_StringProcessing/RegexDSL/Builder.swift +++ b/Sources/_StringProcessing/RegexDSL/Builder.swift @@ -10,21 +10,21 @@ //===----------------------------------------------------------------------===// @resultBuilder -public enum RegexBuilder { +public enum RegexComponentBuilder { @_disfavoredOverload - public static func buildBlock(_ r0: R0) -> R0 { + public static func buildBlock(_ r0: R0) -> R0 { r0 } - public static func buildExpression(_ regex: R) -> R { + public static func buildExpression(_ regex: R) -> R { regex } - public static func buildEither(first component: R) -> R { + public static func buildEither(first component: R) -> R { component } - public static func buildEither(second component: R) -> R { + public static func buildEither(second component: R) -> R { component } } diff --git a/Sources/_StringProcessing/RegexDSL/Core.swift b/Sources/_StringProcessing/RegexDSL/Core.swift index fe6f60bd9..461719c52 100644 --- a/Sources/_StringProcessing/RegexDSL/Core.swift +++ b/Sources/_StringProcessing/RegexDSL/Core.swift @@ -13,13 +13,13 @@ import _MatchingEngine /// A type that represents a regular expression. -public protocol RegexProtocol { +public protocol RegexComponent { associatedtype Match var regex: Regex { get } } /// A regular expression. -public struct Regex: RegexProtocol { +public struct Regex: RegexComponent { /// A program representation that caches any lowered representation for /// execution. internal class Program { @@ -78,14 +78,14 @@ public struct Regex: RegexProtocol { self.init(ast: try! parseWithDelimiters(pattern)) } - public init( + public init( _ content: Content ) where Content.Match == Match { self = content.regex } - public init( - @RegexBuilder _ content: () -> Content + public init( + @RegexComponentBuilder _ content: () -> Content ) where Content.Match == Match { self.init(content()) } @@ -96,7 +96,7 @@ public struct Regex: RegexProtocol { } -public struct MockRegexLiteral: RegexProtocol { +public struct MockRegexLiteral: RegexComponent { public typealias MatchValue = Substring public let regex: Regex diff --git a/Sources/_StringProcessing/RegexDSL/DSL.swift b/Sources/_StringProcessing/RegexDSL/DSL.swift index a21dce82d..cff90e123 100644 --- a/Sources/_StringProcessing/RegexDSL/DSL.swift +++ b/Sources/_StringProcessing/RegexDSL/DSL.swift @@ -13,7 +13,7 @@ import _MatchingEngine // MARK: - Primitives -extension String: RegexProtocol { +extension String: RegexComponent { public typealias Match = Substring public var regex: Regex { @@ -21,7 +21,7 @@ extension String: RegexProtocol { } } -extension Substring: RegexProtocol { +extension Substring: RegexComponent { public typealias Match = Substring public var regex: Regex { @@ -29,7 +29,7 @@ extension Substring: RegexProtocol { } } -extension Character: RegexProtocol { +extension Character: RegexComponent { public typealias Match = Substring public var regex: Regex { @@ -37,7 +37,7 @@ extension Character: RegexProtocol { } } -extension UnicodeScalar: RegexProtocol { +extension UnicodeScalar: RegexComponent { public typealias Match = Substring public var regex: Regex { @@ -45,7 +45,7 @@ extension UnicodeScalar: RegexProtocol { } } -extension CharacterClass: RegexProtocol { +extension CharacterClass: RegexComponent { public typealias Match = Substring public var regex: Regex { @@ -63,7 +63,7 @@ extension CharacterClass: RegexProtocol { // Note: Concatenation overloads are currently gyb'd. // TODO: Variadic generics -// struct Concatenation +// struct Concatenation // where R0.Match == (W0, C0...), R1.Match == (W1, C1...) // { // typealias Match = (Substring, C0..., C1...) @@ -116,7 +116,7 @@ extension QuantificationBehavior { } // TODO: Variadic generics -// struct _OneOrMore +// struct _OneOrMore // where R.Match == (W, C...) // { // typealias Match = (Substring, [(C...)]) @@ -126,7 +126,7 @@ extension QuantificationBehavior { // } // } // -// struct _OneOrMoreNonCapturing { +// struct _OneOrMoreNonCapturing { // typealias Match = Substring // let regex: Regex // init(_ component: Component) { @@ -134,16 +134,16 @@ extension QuantificationBehavior { // } // } // -// func oneOrMore( +// func oneOrMore( // _ component: Component -// ) -> R { +// ) -> R { // _OneOrMore(component) // } // // @_disfavoredOverload -// func oneOrMore( +// func oneOrMore( // _ component: Component -// ) -> R { +// ) -> R { // _OneOrMoreNonCapturing(component) // } @@ -157,9 +157,9 @@ postfix operator .+ // @resultBuilder // struct AlternationBuilder { // @_disfavoredOverload -// func buildBlock(_ regex: R) -> R +// func buildBlock(_ regex: R) -> R // func buildBlock< -// R: RegexProtocol, W0, C0... +// R: RegexComponent, W0, C0... // >( // _ regex: R // ) -> R where R.Match == (W, C...) @@ -168,24 +168,24 @@ postfix operator .+ @resultBuilder public struct AlternationBuilder { @_disfavoredOverload - public static func buildBlock(_ regex: R) -> R { + public static func buildBlock(_ regex: R) -> R { regex } - public static func buildExpression(_ regex: R) -> R { + public static func buildExpression(_ regex: R) -> R { regex } - public static func buildEither(first component: R) -> R { + public static func buildEither(first component: R) -> R { component } - public static func buildEither(second component: R) -> R { + public static func buildEither(second component: R) -> R { component } } -public func choiceOf( +public func choiceOf( @AlternationBuilder builder: () -> R ) -> R { builder() @@ -203,7 +203,7 @@ struct ReferenceID: Hashable, Equatable { } } -public struct Reference: RegexProtocol { +public struct Reference: RegexComponent { let id = ReferenceID() public init(_ captureType: Capture.Type = Capture.self) {} diff --git a/Sources/_StringProcessing/RegexDSL/DSLConsumers.swift b/Sources/_StringProcessing/RegexDSL/DSLConsumers.swift index 79b165655..6b2520973 100644 --- a/Sources/_StringProcessing/RegexDSL/DSLConsumers.swift +++ b/Sources/_StringProcessing/RegexDSL/DSLConsumers.swift @@ -9,7 +9,7 @@ // //===----------------------------------------------------------------------===// -public protocol CustomRegexComponent: RegexProtocol { +public protocol CustomRegexComponent: RegexComponent { func match( _ input: String, startingAt index: String.Index, diff --git a/Sources/_StringProcessing/RegexDSL/Match.swift b/Sources/_StringProcessing/RegexDSL/Match.swift index c5ada0c9d..74d3db6f7 100644 --- a/Sources/_StringProcessing/RegexDSL/Match.swift +++ b/Sources/_StringProcessing/RegexDSL/Match.swift @@ -63,7 +63,7 @@ public struct RegexMatch { } } -extension RegexProtocol { +extension RegexComponent { public func match(in input: String) -> RegexMatch? { _match( input, in: input.startIndex..(_ regex: R) -> RegexMatch? { + public func match(_ regex: R) -> RegexMatch? { regex.match(in: self) } - public func match( - @RegexBuilder _ content: () -> R + public func match( + @RegexComponentBuilder _ content: () -> R ) -> RegexMatch? { match(content()) } } extension Substring { - public func match(_ regex: R) -> RegexMatch? { + public func match(_ regex: R) -> RegexMatch? { regex.match(in: self) } - public func match( - @RegexBuilder _ content: () -> R + public func match( + @RegexComponentBuilder _ content: () -> R ) -> RegexMatch? { match(content()) } diff --git a/Sources/_StringProcessing/RegexDSL/Options.swift b/Sources/_StringProcessing/RegexDSL/Options.swift index da6df0a8e..5163340e0 100644 --- a/Sources/_StringProcessing/RegexDSL/Options.swift +++ b/Sources/_StringProcessing/RegexDSL/Options.swift @@ -11,7 +11,7 @@ import _MatchingEngine -extension RegexProtocol { +extension RegexComponent { public func caseSensitive(_ isCaseSensitive: Bool) -> Regex { // The API is "case sensitive = true or false", so as to avoid the // double negatives inherent in setting "case insensitive" to a Boolean diff --git a/Sources/_StringProcessing/RegexDSL/Variadics.swift b/Sources/_StringProcessing/RegexDSL/Variadics.swift index 3ca1261f1..3314f46b9 100644 --- a/Sources/_StringProcessing/RegexDSL/Variadics.swift +++ b/Sources/_StringProcessing/RegexDSL/Variadics.swift @@ -13,456 +13,456 @@ import _MatchingEngine -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0)> where R0.Match == W0, R1.Match == (W1, C0) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1)> where R0.Match == W0, R1.Match == (W1, C0, C1) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2)> where R0.Match == W0, R1.Match == (W1, C0, C1, C2) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3)> where R0.Match == W0, R1.Match == (W1, C0, C1, C2, C3) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where R0.Match == W0, R1.Match == (W1, C0, C1, C2, C3, C4) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0.Match == W0, R1.Match == (W1, C0, C1, C2, C3, C4, C5) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0.Match == W0, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0.Match == W0, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0.Match == W0, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)> where R0.Match == W0, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1)> where R0.Match == (W0, C0), R1.Match == (W1, C1) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2)> where R0.Match == (W0, C0), R1.Match == (W1, C1, C2) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3)> where R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)> where R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2)> where R0.Match == (W0, C0, C1), R1.Match == (W1, C2) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3)> where R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)> where R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3)> where R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)> where R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)> where R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7, C8) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)> where R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7, C8) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7, C8, C9) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7, C8) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7, C8, C9) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7), R1.Match == (W1, C8) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7), R1.Match == (W1, C8, C9) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7, C8), R1.Match == (W1, C9) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex where R0.Match == W0 { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0)> where R0.Match == (W0, C0) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1)> where R0.Match == (W0, C0, C1) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2)> where R0.Match == (W0, C0, C1, C2) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3)> where R0.Match == (W0, C0, C1, C2, C3) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where R0.Match == (W0, C0, C1, C2, C3, C4) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: combined.regex.root.appending(next.regex.root)) } } -extension RegexBuilder { - public static func buildBlock( +extension RegexComponentBuilder { + public static func buildBlock( combining next: R1, into combined: R0 ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appending(next.regex.root)) @@ -471,7 +471,7 @@ extension RegexBuilder { @_disfavoredOverload -public func optionally( +public func optionally( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex { @@ -479,29 +479,29 @@ public func optionally( } @_disfavoredOverload -public func optionally( +public func optionally( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex { .init(node: .quantification(.zeroOrOne, behavior.astKind, component().regex.root)) } @_disfavoredOverload -public postfix func .?( +public postfix func .?( _ component: Component ) -> Regex { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } -extension RegexBuilder { - public static func buildLimitedAvailability( +extension RegexComponentBuilder { + public static func buildLimitedAvailability( _ component: Component ) -> Regex { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } } @_disfavoredOverload -public func zeroOrMore( +public func zeroOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex { @@ -509,15 +509,15 @@ public func zeroOrMore( } @_disfavoredOverload -public func zeroOrMore( +public func zeroOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex { .init(node: .quantification(.zeroOrMore, behavior.astKind, component().regex.root)) } @_disfavoredOverload -public postfix func .*( +public postfix func .*( _ component: Component ) -> Regex { .init(node: .quantification(.zeroOrMore, .eager, component.regex.root)) @@ -525,7 +525,7 @@ public postfix func .*( @_disfavoredOverload -public func oneOrMore( +public func oneOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex { @@ -533,15 +533,15 @@ public func oneOrMore( } @_disfavoredOverload -public func oneOrMore( +public func oneOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex { .init(node: .quantification(.oneOrMore, behavior.astKind, component().regex.root)) } @_disfavoredOverload -public postfix func .+( +public postfix func .+( _ component: Component ) -> Regex { .init(node: .quantification(.oneOrMore, .eager, component.regex.root)) @@ -549,7 +549,7 @@ public postfix func .+( @_disfavoredOverload -public func repeating( +public func repeating( _ component: Component, count: Int ) -> Regex { @@ -559,9 +559,9 @@ public func repeating( } @_disfavoredOverload -public func repeating( +public func repeating( count: Int, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` @@ -569,7 +569,7 @@ public func repeating( } @_disfavoredOverload -public func repeating( +public func repeating( _ component: Component, _ expression: R, _ behavior: QuantificationBehavior = .eagerly @@ -578,83 +578,83 @@ public func repeating( } @_disfavoredOverload -public func repeating( +public func repeating( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex where R.Bound == Int { .init(node: .repeating(expression.relative(to: 0..( +public func optionally( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?)> where Component.Match == (W, C0) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component.regex.root)) } -public func optionally( +public func optionally( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?)> where Component.Match == (W, C0) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component().regex.root)) } -public postfix func .?( +public postfix func .?( _ component: Component ) -> Regex<(Substring, C0?)> where Component.Match == (W, C0) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } -extension RegexBuilder { - public static func buildLimitedAvailability( +extension RegexComponentBuilder { + public static func buildLimitedAvailability( _ component: Component ) -> Regex<(Substring, C0?)> where Component.Match == (W, C0) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } } -public func zeroOrMore( +public func zeroOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?)> where Component.Match == (W, C0) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component.regex.root)) } -public func zeroOrMore( +public func zeroOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?)> where Component.Match == (W, C0) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component().regex.root)) } -public postfix func .*( +public postfix func .*( _ component: Component ) -> Regex<(Substring, C0?)> where Component.Match == (W, C0) { .init(node: .quantification(.zeroOrMore, .eager, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0)> where Component.Match == (W, C0) { .init(node: .quantification(.oneOrMore, behavior.astKind, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0)> where Component.Match == (W, C0) { .init(node: .quantification(.oneOrMore, behavior.astKind, component().regex.root)) } -public postfix func .+( +public postfix func .+( _ component: Component ) -> Regex<(Substring, C0)> where Component.Match == (W, C0) { .init(node: .quantification(.oneOrMore, .eager, component.regex.root)) } -public func repeating( +public func repeating( _ component: Component, count: Int ) -> Regex<(Substring, C0?)> where Component.Match == (W, C0) { @@ -663,16 +663,16 @@ public func repeating( return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component.regex.root)) } -public func repeating( +public func repeating( count: Int, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?)> where Component.Match == (W, C0) { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component().regex.root)) } -public func repeating( +public func repeating( _ component: Component, _ expression: R, _ behavior: QuantificationBehavior = .eagerly @@ -680,83 +680,83 @@ public func repeating( .init(node: .repeating(expression.relative(to: 0..( +public func repeating( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?)> where Component.Match == (W, C0), R.Bound == Int { .init(node: .repeating(expression.relative(to: 0..( +public func optionally( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?)> where Component.Match == (W, C0, C1) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component.regex.root)) } -public func optionally( +public func optionally( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?)> where Component.Match == (W, C0, C1) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component().regex.root)) } -public postfix func .?( +public postfix func .?( _ component: Component ) -> Regex<(Substring, C0?, C1?)> where Component.Match == (W, C0, C1) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } -extension RegexBuilder { - public static func buildLimitedAvailability( +extension RegexComponentBuilder { + public static func buildLimitedAvailability( _ component: Component ) -> Regex<(Substring, C0?, C1?)> where Component.Match == (W, C0, C1) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } } -public func zeroOrMore( +public func zeroOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?)> where Component.Match == (W, C0, C1) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component.regex.root)) } -public func zeroOrMore( +public func zeroOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?)> where Component.Match == (W, C0, C1) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component().regex.root)) } -public postfix func .*( +public postfix func .*( _ component: Component ) -> Regex<(Substring, C0?, C1?)> where Component.Match == (W, C0, C1) { .init(node: .quantification(.zeroOrMore, .eager, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0, C1)> where Component.Match == (W, C0, C1) { .init(node: .quantification(.oneOrMore, behavior.astKind, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0, C1)> where Component.Match == (W, C0, C1) { .init(node: .quantification(.oneOrMore, behavior.astKind, component().regex.root)) } -public postfix func .+( +public postfix func .+( _ component: Component ) -> Regex<(Substring, C0, C1)> where Component.Match == (W, C0, C1) { .init(node: .quantification(.oneOrMore, .eager, component.regex.root)) } -public func repeating( +public func repeating( _ component: Component, count: Int ) -> Regex<(Substring, C0?, C1?)> where Component.Match == (W, C0, C1) { @@ -765,16 +765,16 @@ public func repeating( return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component.regex.root)) } -public func repeating( +public func repeating( count: Int, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?)> where Component.Match == (W, C0, C1) { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component().regex.root)) } -public func repeating( +public func repeating( _ component: Component, _ expression: R, _ behavior: QuantificationBehavior = .eagerly @@ -782,83 +782,83 @@ public func repeating( .init(node: .repeating(expression.relative(to: 0..( +public func repeating( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?)> where Component.Match == (W, C0, C1), R.Bound == Int { .init(node: .repeating(expression.relative(to: 0..( +public func optionally( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?)> where Component.Match == (W, C0, C1, C2) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component.regex.root)) } -public func optionally( +public func optionally( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?)> where Component.Match == (W, C0, C1, C2) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component().regex.root)) } -public postfix func .?( +public postfix func .?( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?)> where Component.Match == (W, C0, C1, C2) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } -extension RegexBuilder { - public static func buildLimitedAvailability( +extension RegexComponentBuilder { + public static func buildLimitedAvailability( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?)> where Component.Match == (W, C0, C1, C2) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } } -public func zeroOrMore( +public func zeroOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?)> where Component.Match == (W, C0, C1, C2) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component.regex.root)) } -public func zeroOrMore( +public func zeroOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?)> where Component.Match == (W, C0, C1, C2) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component().regex.root)) } -public postfix func .*( +public postfix func .*( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?)> where Component.Match == (W, C0, C1, C2) { .init(node: .quantification(.zeroOrMore, .eager, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0, C1, C2)> where Component.Match == (W, C0, C1, C2) { .init(node: .quantification(.oneOrMore, behavior.astKind, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0, C1, C2)> where Component.Match == (W, C0, C1, C2) { .init(node: .quantification(.oneOrMore, behavior.astKind, component().regex.root)) } -public postfix func .+( +public postfix func .+( _ component: Component ) -> Regex<(Substring, C0, C1, C2)> where Component.Match == (W, C0, C1, C2) { .init(node: .quantification(.oneOrMore, .eager, component.regex.root)) } -public func repeating( +public func repeating( _ component: Component, count: Int ) -> Regex<(Substring, C0?, C1?, C2?)> where Component.Match == (W, C0, C1, C2) { @@ -867,16 +867,16 @@ public func repeating( return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component.regex.root)) } -public func repeating( +public func repeating( count: Int, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?)> where Component.Match == (W, C0, C1, C2) { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component().regex.root)) } -public func repeating( +public func repeating( _ component: Component, _ expression: R, _ behavior: QuantificationBehavior = .eagerly @@ -884,83 +884,83 @@ public func repeating( +public func repeating( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?)> where Component.Match == (W, C0, C1, C2), R.Bound == Int { .init(node: .repeating(expression.relative(to: 0..( +public func optionally( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where Component.Match == (W, C0, C1, C2, C3) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component.regex.root)) } -public func optionally( +public func optionally( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where Component.Match == (W, C0, C1, C2, C3) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component().regex.root)) } -public postfix func .?( +public postfix func .?( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where Component.Match == (W, C0, C1, C2, C3) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } -extension RegexBuilder { - public static func buildLimitedAvailability( +extension RegexComponentBuilder { + public static func buildLimitedAvailability( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where Component.Match == (W, C0, C1, C2, C3) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } } -public func zeroOrMore( +public func zeroOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where Component.Match == (W, C0, C1, C2, C3) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component.regex.root)) } -public func zeroOrMore( +public func zeroOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where Component.Match == (W, C0, C1, C2, C3) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component().regex.root)) } -public postfix func .*( +public postfix func .*( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where Component.Match == (W, C0, C1, C2, C3) { .init(node: .quantification(.zeroOrMore, .eager, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0, C1, C2, C3)> where Component.Match == (W, C0, C1, C2, C3) { .init(node: .quantification(.oneOrMore, behavior.astKind, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0, C1, C2, C3)> where Component.Match == (W, C0, C1, C2, C3) { .init(node: .quantification(.oneOrMore, behavior.astKind, component().regex.root)) } -public postfix func .+( +public postfix func .+( _ component: Component ) -> Regex<(Substring, C0, C1, C2, C3)> where Component.Match == (W, C0, C1, C2, C3) { .init(node: .quantification(.oneOrMore, .eager, component.regex.root)) } -public func repeating( +public func repeating( _ component: Component, count: Int ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where Component.Match == (W, C0, C1, C2, C3) { @@ -969,16 +969,16 @@ public func repeating( return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component.regex.root)) } -public func repeating( +public func repeating( count: Int, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where Component.Match == (W, C0, C1, C2, C3) { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component().regex.root)) } -public func repeating( +public func repeating( _ component: Component, _ expression: R, _ behavior: QuantificationBehavior = .eagerly @@ -986,83 +986,83 @@ public func repeating( +public func repeating( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where Component.Match == (W, C0, C1, C2, C3), R.Bound == Int { .init(node: .repeating(expression.relative(to: 0..( +public func optionally( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where Component.Match == (W, C0, C1, C2, C3, C4) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component.regex.root)) } -public func optionally( +public func optionally( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where Component.Match == (W, C0, C1, C2, C3, C4) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component().regex.root)) } -public postfix func .?( +public postfix func .?( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where Component.Match == (W, C0, C1, C2, C3, C4) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } -extension RegexBuilder { - public static func buildLimitedAvailability( +extension RegexComponentBuilder { + public static func buildLimitedAvailability( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where Component.Match == (W, C0, C1, C2, C3, C4) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } } -public func zeroOrMore( +public func zeroOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where Component.Match == (W, C0, C1, C2, C3, C4) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component.regex.root)) } -public func zeroOrMore( +public func zeroOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where Component.Match == (W, C0, C1, C2, C3, C4) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component().regex.root)) } -public postfix func .*( +public postfix func .*( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where Component.Match == (W, C0, C1, C2, C3, C4) { .init(node: .quantification(.zeroOrMore, .eager, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where Component.Match == (W, C0, C1, C2, C3, C4) { .init(node: .quantification(.oneOrMore, behavior.astKind, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where Component.Match == (W, C0, C1, C2, C3, C4) { .init(node: .quantification(.oneOrMore, behavior.astKind, component().regex.root)) } -public postfix func .+( +public postfix func .+( _ component: Component ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where Component.Match == (W, C0, C1, C2, C3, C4) { .init(node: .quantification(.oneOrMore, .eager, component.regex.root)) } -public func repeating( +public func repeating( _ component: Component, count: Int ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where Component.Match == (W, C0, C1, C2, C3, C4) { @@ -1071,16 +1071,16 @@ public func repeating( return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component.regex.root)) } -public func repeating( +public func repeating( count: Int, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where Component.Match == (W, C0, C1, C2, C3, C4) { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component().regex.root)) } -public func repeating( +public func repeating( _ component: Component, _ expression: R, _ behavior: QuantificationBehavior = .eagerly @@ -1088,83 +1088,83 @@ public func repeating( +public func repeating( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where Component.Match == (W, C0, C1, C2, C3, C4), R.Bound == Int { .init(node: .repeating(expression.relative(to: 0..( +public func optionally( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component.regex.root)) } -public func optionally( +public func optionally( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component().regex.root)) } -public postfix func .?( +public postfix func .?( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } -extension RegexBuilder { - public static func buildLimitedAvailability( +extension RegexComponentBuilder { + public static func buildLimitedAvailability( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } } -public func zeroOrMore( +public func zeroOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component.regex.root)) } -public func zeroOrMore( +public func zeroOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component().regex.root)) } -public postfix func .*( +public postfix func .*( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .quantification(.zeroOrMore, .eager, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .quantification(.oneOrMore, behavior.astKind, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .quantification(.oneOrMore, behavior.astKind, component().regex.root)) } -public postfix func .+( +public postfix func .+( _ component: Component ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .quantification(.oneOrMore, .eager, component.regex.root)) } -public func repeating( +public func repeating( _ component: Component, count: Int ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { @@ -1173,16 +1173,16 @@ public func repeating( return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component.regex.root)) } -public func repeating( +public func repeating( count: Int, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5) { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component().regex.root)) } -public func repeating( +public func repeating( _ component: Component, _ expression: R, _ behavior: QuantificationBehavior = .eagerly @@ -1190,83 +1190,83 @@ public func repeating( +public func repeating( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5), R.Bound == Int { .init(node: .repeating(expression.relative(to: 0..( +public func optionally( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component.regex.root)) } -public func optionally( +public func optionally( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component().regex.root)) } -public postfix func .?( +public postfix func .?( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } -extension RegexBuilder { - public static func buildLimitedAvailability( +extension RegexComponentBuilder { + public static func buildLimitedAvailability( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } } -public func zeroOrMore( +public func zeroOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component.regex.root)) } -public func zeroOrMore( +public func zeroOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component().regex.root)) } -public postfix func .*( +public postfix func .*( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .quantification(.zeroOrMore, .eager, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .quantification(.oneOrMore, behavior.astKind, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .quantification(.oneOrMore, behavior.astKind, component().regex.root)) } -public postfix func .+( +public postfix func .+( _ component: Component ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .quantification(.oneOrMore, .eager, component.regex.root)) } -public func repeating( +public func repeating( _ component: Component, count: Int ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { @@ -1275,16 +1275,16 @@ public func repeating( return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component.regex.root)) } -public func repeating( +public func repeating( count: Int, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6) { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component().regex.root)) } -public func repeating( +public func repeating( _ component: Component, _ expression: R, _ behavior: QuantificationBehavior = .eagerly @@ -1292,83 +1292,83 @@ public func repeating( +public func repeating( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6), R.Bound == Int { .init(node: .repeating(expression.relative(to: 0..( +public func optionally( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component.regex.root)) } -public func optionally( +public func optionally( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component().regex.root)) } -public postfix func .?( +public postfix func .?( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } -extension RegexBuilder { - public static func buildLimitedAvailability( +extension RegexComponentBuilder { + public static func buildLimitedAvailability( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } } -public func zeroOrMore( +public func zeroOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component.regex.root)) } -public func zeroOrMore( +public func zeroOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component().regex.root)) } -public postfix func .*( +public postfix func .*( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .quantification(.zeroOrMore, .eager, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .quantification(.oneOrMore, behavior.astKind, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .quantification(.oneOrMore, behavior.astKind, component().regex.root)) } -public postfix func .+( +public postfix func .+( _ component: Component ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .quantification(.oneOrMore, .eager, component.regex.root)) } -public func repeating( +public func repeating( _ component: Component, count: Int ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { @@ -1377,16 +1377,16 @@ public func repeating( +public func repeating( count: Int, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component().regex.root)) } -public func repeating( +public func repeating( _ component: Component, _ expression: R, _ behavior: QuantificationBehavior = .eagerly @@ -1394,83 +1394,83 @@ public func repeating( +public func repeating( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7), R.Bound == Int { .init(node: .repeating(expression.relative(to: 0..( +public func optionally( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component.regex.root)) } -public func optionally( +public func optionally( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .quantification(.zeroOrOne, behavior.astKind, component().regex.root)) } -public postfix func .?( +public postfix func .?( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } -extension RegexBuilder { - public static func buildLimitedAvailability( +extension RegexComponentBuilder { + public static func buildLimitedAvailability( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .quantification(.zeroOrOne, .eager, component.regex.root)) } } -public func zeroOrMore( +public func zeroOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component.regex.root)) } -public func zeroOrMore( +public func zeroOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .quantification(.zeroOrMore, behavior.astKind, component().regex.root)) } -public postfix func .*( +public postfix func .*( _ component: Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .quantification(.zeroOrMore, .eager, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ component: Component, _ behavior: QuantificationBehavior = .eagerly ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .quantification(.oneOrMore, behavior.astKind, component.regex.root)) } -public func oneOrMore( +public func oneOrMore( _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .quantification(.oneOrMore, behavior.astKind, component().regex.root)) } -public postfix func .+( +public postfix func .+( _ component: Component ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .quantification(.oneOrMore, .eager, component.regex.root)) } -public func repeating( +public func repeating( _ component: Component, count: Int ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { @@ -1479,16 +1479,16 @@ public func repeating( +public func repeating( count: Int, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { assert(count > 0, "Must specify a positive count") // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)` return Regex(node: .quantification(.exactly(.init(faking: count)), .eager, component().regex.root)) } -public func repeating( +public func repeating( _ component: Component, _ expression: R, _ behavior: QuantificationBehavior = .eagerly @@ -1496,788 +1496,788 @@ public func repeating( +public func repeating( _ expression: R, _ behavior: QuantificationBehavior = .eagerly, - @RegexBuilder _ component: () -> Component + @RegexComponentBuilder _ component: () -> Component ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where Component.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8), R.Bound == Int { .init(node: .repeating(expression.relative(to: 0..( combining next: R1, into combined: R0 - ) -> Regex where R0: RegexProtocol, R1: RegexProtocol { + ) -> Regex where R0: RegexComponent, R1: RegexComponent { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex where R0: RegexProtocol, R1: RegexProtocol { +public func | (lhs: R0, rhs: R1) -> Regex where R0: RegexComponent, R1: RegexComponent { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0) { + ) -> Regex<(Substring, C0?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0?, C1?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1) { + ) -> Regex<(Substring, C0?, C1?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0?, C1?, C2?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2) { + ) -> Regex<(Substring, C0?, C1?, C2?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3) { + ) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4) { + ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4, C5) { + ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4, C5) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4, C5) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4, C5) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6) { + ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7) { + ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7, C8) { + ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7, C8) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9) { + ) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R1.Match == (W1, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0) { + ) -> Regex<(Substring, C0)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1) { + ) -> Regex<(Substring, C0, C1?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1?, C2?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2) { + ) -> Regex<(Substring, C0, C1?, C2?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1?, C2?, C3?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3) { + ) -> Regex<(Substring, C0, C1?, C2?, C3?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4) { + ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5) { + ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6) { + ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7) { + ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7, C8) { + ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7, C8) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7, C8, C9) { + ) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7, C8, C9) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0), R1.Match == (W1, C1, C2, C3, C4, C5, C6, C7, C8, C9) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1) { + ) -> Regex<(Substring, C0, C1)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2) { + ) -> Regex<(Substring, C0, C1, C2?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2?, C3?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3) { + ) -> Regex<(Substring, C0, C1, C2?, C3?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4) { + ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5) { + ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6) { + ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7) { + ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7, C8) { + ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7, C8) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7, C8) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7, C8, C9) { + ) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7, C8, C9) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1), R1.Match == (W1, C2, C3, C4, C5, C6, C7, C8, C9) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2) { + ) -> Regex<(Substring, C0, C1, C2)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3) { + ) -> Regex<(Substring, C0, C1, C2, C3?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3?, C4?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4) { + ) -> Regex<(Substring, C0, C1, C2, C3?, C4?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5) { + ) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6) { + ) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7) { + ) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7, C8) { + ) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7, C8) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7, C8) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7, C8, C9) { + ) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7, C8, C9) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3?, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2), R1.Match == (W1, C3, C4, C5, C6, C7, C8, C9) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3) { + ) -> Regex<(Substring, C0, C1, C2, C3)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7, C8) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7, C8) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7, C8) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7, C8, C9) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7, C8, C9) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4?, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3), R1.Match == (W1, C4, C5, C6, C7, C8, C9) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7, C8) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7, C8) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7, C8) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7, C8) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7, C8, C9) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7, C8, C9) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7, C8, C9) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5?, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4), R1.Match == (W1, C5, C6, C7, C8, C9) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7, C8) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7, C8) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7, C8) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7, C8) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7, C8, C9) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7, C8, C9) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7, C8, C9) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6?, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5), R1.Match == (W1, C6, C7, C8, C9) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7, C8) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7, C8) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7, C8) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7, C8) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7, C8, C9) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7, C8, C9) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7, C8, C9) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7?, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6), R1.Match == (W1, C7, C8, C9) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7), R1.Match == (W1, C8) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7), R1.Match == (W1, C8) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7), R1.Match == (W1, C8) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7), R1.Match == (W1, C8) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7), R1.Match == (W1, C8, C9) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7), R1.Match == (W1, C8, C9) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8?, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7), R1.Match == (W1, C8, C9) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8?, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7), R1.Match == (W1, C8, C9) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7, C8) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7, C8) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { public static func buildBlock( combining next: R1, into combined: R0 - ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7, C8), R1.Match == (W1, C9) { + ) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7, C8), R1.Match == (W1, C9) { .init(node: combined.regex.root.appendingAlternationCase(next.regex.root)) } } -public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9?)> where R0: RegexProtocol, R1: RegexProtocol, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7, C8), R1.Match == (W1, C9) { +public func | (lhs: R0, rhs: R1) -> Regex<(Substring, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9?)> where R0: RegexComponent, R1: RegexComponent, R0.Match == (W0, C0, C1, C2, C3, C4, C5, C6, C7, C8), R1.Match == (W1, C9) { .init(node: lhs.regex.root.appendingAlternationCase(rhs.regex.root)) } extension AlternationBuilder { - public static func buildBlock(_ regex: R) -> Regex<(W, C0?)> where R: RegexProtocol, R.Match == (W, C0) { + public static func buildBlock(_ regex: R) -> Regex<(W, C0?)> where R: RegexComponent, R.Match == (W, C0) { .init(node: .alternation([regex.regex.root])) } } extension AlternationBuilder { - public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?)> where R: RegexProtocol, R.Match == (W, C0, C1) { + public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?)> where R: RegexComponent, R.Match == (W, C0, C1) { .init(node: .alternation([regex.regex.root])) } } extension AlternationBuilder { - public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?)> where R: RegexProtocol, R.Match == (W, C0, C1, C2) { + public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?)> where R: RegexComponent, R.Match == (W, C0, C1, C2) { .init(node: .alternation([regex.regex.root])) } } extension AlternationBuilder { - public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?)> where R: RegexProtocol, R.Match == (W, C0, C1, C2, C3) { + public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?)> where R: RegexComponent, R.Match == (W, C0, C1, C2, C3) { .init(node: .alternation([regex.regex.root])) } } extension AlternationBuilder { - public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?, C4?)> where R: RegexProtocol, R.Match == (W, C0, C1, C2, C3, C4) { + public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?, C4?)> where R: RegexComponent, R.Match == (W, C0, C1, C2, C3, C4) { .init(node: .alternation([regex.regex.root])) } } extension AlternationBuilder { - public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?, C4?, C5?)> where R: RegexProtocol, R.Match == (W, C0, C1, C2, C3, C4, C5) { + public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?, C4?, C5?)> where R: RegexComponent, R.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .alternation([regex.regex.root])) } } extension AlternationBuilder { - public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where R: RegexProtocol, R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { + public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?, C4?, C5?, C6?)> where R: RegexComponent, R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .alternation([regex.regex.root])) } } extension AlternationBuilder { - public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where R: RegexProtocol, R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { + public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?)> where R: RegexComponent, R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .alternation([regex.regex.root])) } } extension AlternationBuilder { - public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R: RegexProtocol, R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { + public static func buildBlock(_ regex: R) -> Regex<(W, C0?, C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?)> where R: RegexComponent, R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .alternation([regex.regex.root])) } } // MARK: - Non-builder capture arity 0 -public func capture( +public func capture( _ component: R ) -> Regex<(Substring, W)> where R.Match == W { .init(node: .group(.capture, component.regex.root)) } -public func capture( +public func capture( _ component: R, as reference: Reference ) -> Regex<(Substring, W)> where R.Match == W { .init(node: .group(.capture, component.regex.root, reference.id)) } -public func capture( +public func capture( _ component: R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture)> where R.Match == W { @@ -2289,7 +2289,7 @@ public func capture( })) } -public func capture( +public func capture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture @@ -2303,7 +2303,7 @@ public func capture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture)> where R.Match == W { @@ -2315,7 +2315,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) throws -> NewCapture @@ -2329,7 +2329,7 @@ public func tryCapture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture)> where R.Match == W { @@ -2341,7 +2341,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture? @@ -2357,21 +2357,21 @@ public func tryCapture( // MARK: - Builder capture arity 0 -public func capture( - @RegexBuilder _ component: () -> R +public func capture( + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W)> where R.Match == W { .init(node: .group(.capture, component().regex.root)) } -public func capture( +public func capture( as reference: Reference, - @RegexBuilder _ component: () -> R + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W)> where R.Match == W { .init(node: .group(.capture, component().regex.root, reference.id)) } -public func capture( - @RegexBuilder _ component: () -> R, +public func capture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture)> where R.Match == W { .init(node: .groupTransform( @@ -2382,9 +2382,9 @@ public func capture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture)> where R.Match == W { .init(node: .groupTransform( @@ -2396,8 +2396,8 @@ public func tryCapture( reference.id)) } -public func tryCapture( - @RegexBuilder _ component: () -> R, +public func tryCapture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture)> where R.Match == W { .init(node: .groupTransform( @@ -2408,9 +2408,9 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture)> where R.Match == W { .init(node: .groupTransform( @@ -2424,19 +2424,19 @@ public func tryCapture( // MARK: - Non-builder capture arity 1 -public func capture( +public func capture( _ component: R ) -> Regex<(Substring, W, C0)> where R.Match == (W, C0) { .init(node: .group(.capture, component.regex.root)) } -public func capture( +public func capture( _ component: R, as reference: Reference ) -> Regex<(Substring, W, C0)> where R.Match == (W, C0) { .init(node: .group(.capture, component.regex.root, reference.id)) } -public func capture( +public func capture( _ component: R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0)> where R.Match == (W, C0) { @@ -2448,7 +2448,7 @@ public func capture( })) } -public func capture( +public func capture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture @@ -2462,7 +2462,7 @@ public func capture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0)> where R.Match == (W, C0) { @@ -2474,7 +2474,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) throws -> NewCapture @@ -2488,7 +2488,7 @@ public func tryCapture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0)> where R.Match == (W, C0) { @@ -2500,7 +2500,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture? @@ -2516,21 +2516,21 @@ public func tryCapture( // MARK: - Builder capture arity 1 -public func capture( - @RegexBuilder _ component: () -> R +public func capture( + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0)> where R.Match == (W, C0) { .init(node: .group(.capture, component().regex.root)) } -public func capture( +public func capture( as reference: Reference, - @RegexBuilder _ component: () -> R + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0)> where R.Match == (W, C0) { .init(node: .group(.capture, component().regex.root, reference.id)) } -public func capture( - @RegexBuilder _ component: () -> R, +public func capture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0)> where R.Match == (W, C0) { .init(node: .groupTransform( @@ -2541,9 +2541,9 @@ public func capture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0)> where R.Match == (W, C0) { .init(node: .groupTransform( @@ -2555,8 +2555,8 @@ public func tryCapture( reference.id)) } -public func tryCapture( - @RegexBuilder _ component: () -> R, +public func tryCapture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0)> where R.Match == (W, C0) { .init(node: .groupTransform( @@ -2567,9 +2567,9 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0)> where R.Match == (W, C0) { .init(node: .groupTransform( @@ -2583,19 +2583,19 @@ public func tryCapture( // MARK: - Non-builder capture arity 2 -public func capture( +public func capture( _ component: R ) -> Regex<(Substring, W, C0, C1)> where R.Match == (W, C0, C1) { .init(node: .group(.capture, component.regex.root)) } -public func capture( +public func capture( _ component: R, as reference: Reference ) -> Regex<(Substring, W, C0, C1)> where R.Match == (W, C0, C1) { .init(node: .group(.capture, component.regex.root, reference.id)) } -public func capture( +public func capture( _ component: R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1)> where R.Match == (W, C0, C1) { @@ -2607,7 +2607,7 @@ public func capture( })) } -public func capture( +public func capture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture @@ -2621,7 +2621,7 @@ public func capture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1)> where R.Match == (W, C0, C1) { @@ -2633,7 +2633,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) throws -> NewCapture @@ -2647,7 +2647,7 @@ public func tryCapture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1)> where R.Match == (W, C0, C1) { @@ -2659,7 +2659,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture? @@ -2675,21 +2675,21 @@ public func tryCapture( // MARK: - Builder capture arity 2 -public func capture( - @RegexBuilder _ component: () -> R +public func capture( + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1)> where R.Match == (W, C0, C1) { .init(node: .group(.capture, component().regex.root)) } -public func capture( +public func capture( as reference: Reference, - @RegexBuilder _ component: () -> R + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1)> where R.Match == (W, C0, C1) { .init(node: .group(.capture, component().regex.root, reference.id)) } -public func capture( - @RegexBuilder _ component: () -> R, +public func capture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1)> where R.Match == (W, C0, C1) { .init(node: .groupTransform( @@ -2700,9 +2700,9 @@ public func capture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1)> where R.Match == (W, C0, C1) { .init(node: .groupTransform( @@ -2714,8 +2714,8 @@ public func tryCapture( reference.id)) } -public func tryCapture( - @RegexBuilder _ component: () -> R, +public func tryCapture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1)> where R.Match == (W, C0, C1) { .init(node: .groupTransform( @@ -2726,9 +2726,9 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1)> where R.Match == (W, C0, C1) { .init(node: .groupTransform( @@ -2742,19 +2742,19 @@ public func tryCapture( // MARK: - Non-builder capture arity 3 -public func capture( +public func capture( _ component: R ) -> Regex<(Substring, W, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { .init(node: .group(.capture, component.regex.root)) } -public func capture( +public func capture( _ component: R, as reference: Reference ) -> Regex<(Substring, W, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { .init(node: .group(.capture, component.regex.root, reference.id)) } -public func capture( +public func capture( _ component: R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { @@ -2766,7 +2766,7 @@ public func capture( })) } -public func capture( +public func capture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture @@ -2780,7 +2780,7 @@ public func capture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { @@ -2792,7 +2792,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) throws -> NewCapture @@ -2806,7 +2806,7 @@ public func tryCapture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { @@ -2818,7 +2818,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture? @@ -2834,21 +2834,21 @@ public func tryCapture( // MARK: - Builder capture arity 3 -public func capture( - @RegexBuilder _ component: () -> R +public func capture( + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { .init(node: .group(.capture, component().regex.root)) } -public func capture( +public func capture( as reference: Reference, - @RegexBuilder _ component: () -> R + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { .init(node: .group(.capture, component().regex.root, reference.id)) } -public func capture( - @RegexBuilder _ component: () -> R, +public func capture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { .init(node: .groupTransform( @@ -2859,9 +2859,9 @@ public func capture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { .init(node: .groupTransform( @@ -2873,8 +2873,8 @@ public func tryCapture( reference.id)) } -public func tryCapture( - @RegexBuilder _ component: () -> R, +public func tryCapture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { .init(node: .groupTransform( @@ -2885,9 +2885,9 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2)> where R.Match == (W, C0, C1, C2) { .init(node: .groupTransform( @@ -2901,19 +2901,19 @@ public func tryCapture( // MARK: - Non-builder capture arity 4 -public func capture( +public func capture( _ component: R ) -> Regex<(Substring, W, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { .init(node: .group(.capture, component.regex.root)) } -public func capture( +public func capture( _ component: R, as reference: Reference ) -> Regex<(Substring, W, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { .init(node: .group(.capture, component.regex.root, reference.id)) } -public func capture( +public func capture( _ component: R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { @@ -2925,7 +2925,7 @@ public func capture( })) } -public func capture( +public func capture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture @@ -2939,7 +2939,7 @@ public func capture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { @@ -2951,7 +2951,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) throws -> NewCapture @@ -2965,7 +2965,7 @@ public func tryCapture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { @@ -2977,7 +2977,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture? @@ -2993,21 +2993,21 @@ public func tryCapture( // MARK: - Builder capture arity 4 -public func capture( - @RegexBuilder _ component: () -> R +public func capture( + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { .init(node: .group(.capture, component().regex.root)) } -public func capture( +public func capture( as reference: Reference, - @RegexBuilder _ component: () -> R + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { .init(node: .group(.capture, component().regex.root, reference.id)) } -public func capture( - @RegexBuilder _ component: () -> R, +public func capture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { .init(node: .groupTransform( @@ -3018,9 +3018,9 @@ public func capture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { .init(node: .groupTransform( @@ -3032,8 +3032,8 @@ public func tryCapture( reference.id)) } -public func tryCapture( - @RegexBuilder _ component: () -> R, +public func tryCapture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { .init(node: .groupTransform( @@ -3044,9 +3044,9 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3)> where R.Match == (W, C0, C1, C2, C3) { .init(node: .groupTransform( @@ -3060,19 +3060,19 @@ public func tryCapture( // MARK: - Non-builder capture arity 5 -public func capture( +public func capture( _ component: R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { .init(node: .group(.capture, component.regex.root)) } -public func capture( +public func capture( _ component: R, as reference: Reference ) -> Regex<(Substring, W, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { .init(node: .group(.capture, component.regex.root, reference.id)) } -public func capture( +public func capture( _ component: R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { @@ -3084,7 +3084,7 @@ public func capture( })) } -public func capture( +public func capture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture @@ -3098,7 +3098,7 @@ public func capture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { @@ -3110,7 +3110,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) throws -> NewCapture @@ -3124,7 +3124,7 @@ public func tryCapture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { @@ -3136,7 +3136,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture? @@ -3152,21 +3152,21 @@ public func tryCapture( // MARK: - Builder capture arity 5 -public func capture( - @RegexBuilder _ component: () -> R +public func capture( + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { .init(node: .group(.capture, component().regex.root)) } -public func capture( +public func capture( as reference: Reference, - @RegexBuilder _ component: () -> R + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { .init(node: .group(.capture, component().regex.root, reference.id)) } -public func capture( - @RegexBuilder _ component: () -> R, +public func capture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { .init(node: .groupTransform( @@ -3177,9 +3177,9 @@ public func capture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { .init(node: .groupTransform( @@ -3191,8 +3191,8 @@ public func tryCapture( reference.id)) } -public func tryCapture( - @RegexBuilder _ component: () -> R, +public func tryCapture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { .init(node: .groupTransform( @@ -3203,9 +3203,9 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4)> where R.Match == (W, C0, C1, C2, C3, C4) { .init(node: .groupTransform( @@ -3219,19 +3219,19 @@ public func tryCapture( // MARK: - Non-builder capture arity 6 -public func capture( +public func capture( _ component: R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .group(.capture, component.regex.root)) } -public func capture( +public func capture( _ component: R, as reference: Reference ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .group(.capture, component.regex.root, reference.id)) } -public func capture( +public func capture( _ component: R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { @@ -3243,7 +3243,7 @@ public func capture( })) } -public func capture( +public func capture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture @@ -3257,7 +3257,7 @@ public func capture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { @@ -3269,7 +3269,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) throws -> NewCapture @@ -3283,7 +3283,7 @@ public func tryCapture( reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { @@ -3295,7 +3295,7 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture? @@ -3311,21 +3311,21 @@ public func tryCapture( // MARK: - Builder capture arity 6 -public func capture( - @RegexBuilder _ component: () -> R +public func capture( + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .group(.capture, component().regex.root)) } -public func capture( +public func capture( as reference: Reference, - @RegexBuilder _ component: () -> R + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .group(.capture, component().regex.root, reference.id)) } -public func capture( - @RegexBuilder _ component: () -> R, +public func capture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .groupTransform( @@ -3336,9 +3336,9 @@ public func capture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .groupTransform( @@ -3350,8 +3350,8 @@ public func tryCapture( reference.id)) } -public func tryCapture( - @RegexBuilder _ component: () -> R, +public func tryCapture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .groupTransform( @@ -3362,9 +3362,9 @@ public func tryCapture( })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5)> where R.Match == (W, C0, C1, C2, C3, C4, C5) { .init(node: .groupTransform( @@ -3378,19 +3378,19 @@ public func tryCapture( // MARK: - Non-builder capture arity 7 -public func capture( +public func capture( _ component: R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .group(.capture, component.regex.root)) } -public func capture( +public func capture( _ component: R, as reference: Reference ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .group(.capture, component.regex.root, reference.id)) } -public func capture( +public func capture( _ component: R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { @@ -3402,7 +3402,7 @@ public func capture })) } -public func capture( +public func capture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture @@ -3416,7 +3416,7 @@ public func capture reference.id)) } -public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { @@ -3428,7 +3428,7 @@ public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) throws -> NewCapture @@ -3442,7 +3442,7 @@ public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { @@ -3454,7 +3454,7 @@ public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture? @@ -3470,21 +3470,21 @@ public func tryCapture( - @RegexBuilder _ component: () -> R +public func capture( + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .group(.capture, component().regex.root)) } -public func capture( +public func capture( as reference: Reference, - @RegexBuilder _ component: () -> R + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .group(.capture, component().regex.root, reference.id)) } -public func capture( - @RegexBuilder _ component: () -> R, +public func capture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .groupTransform( @@ -3495,9 +3495,9 @@ public func capture })) } -public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .groupTransform( @@ -3509,8 +3509,8 @@ public func tryCapture( - @RegexBuilder _ component: () -> R, +public func tryCapture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .groupTransform( @@ -3521,9 +3521,9 @@ public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6) { .init(node: .groupTransform( @@ -3537,19 +3537,19 @@ public func tryCapture( +public func capture( _ component: R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .group(.capture, component.regex.root)) } -public func capture( +public func capture( _ component: R, as reference: Reference ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .group(.capture, component.regex.root, reference.id)) } -public func capture( +public func capture( _ component: R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { @@ -3561,7 +3561,7 @@ public func capture( +public func capture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture @@ -3575,7 +3575,7 @@ public func capture( +public func tryCapture( _ component: R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { @@ -3587,7 +3587,7 @@ public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) throws -> NewCapture @@ -3601,7 +3601,7 @@ public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { @@ -3613,7 +3613,7 @@ public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture? @@ -3629,21 +3629,21 @@ public func tryCapture( - @RegexBuilder _ component: () -> R +public func capture( + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .group(.capture, component().regex.root)) } -public func capture( +public func capture( as reference: Reference, - @RegexBuilder _ component: () -> R + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .group(.capture, component().regex.root, reference.id)) } -public func capture( - @RegexBuilder _ component: () -> R, +public func capture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .groupTransform( @@ -3654,9 +3654,9 @@ public func capture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .groupTransform( @@ -3668,8 +3668,8 @@ public func tryCapture( - @RegexBuilder _ component: () -> R, +public func tryCapture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .groupTransform( @@ -3680,9 +3680,9 @@ public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7) { .init(node: .groupTransform( @@ -3696,19 +3696,19 @@ public func tryCapture( +public func capture( _ component: R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .group(.capture, component.regex.root)) } -public func capture( +public func capture( _ component: R, as reference: Reference ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .group(.capture, component.regex.root, reference.id)) } -public func capture( +public func capture( _ component: R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { @@ -3720,7 +3720,7 @@ public func capture( +public func capture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture @@ -3734,7 +3734,7 @@ public func capture( +public func tryCapture( _ component: R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { @@ -3746,7 +3746,7 @@ public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) throws -> NewCapture @@ -3760,7 +3760,7 @@ public func tryCapture( +public func tryCapture( _ component: R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { @@ -3772,7 +3772,7 @@ public func tryCapture( +public func tryCapture( _ component: R, as reference: Reference, transform: @escaping (Substring) -> NewCapture? @@ -3788,21 +3788,21 @@ public func tryCapture( - @RegexBuilder _ component: () -> R +public func capture( + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .group(.capture, component().regex.root)) } -public func capture( +public func capture( as reference: Reference, - @RegexBuilder _ component: () -> R + @RegexComponentBuilder _ component: () -> R ) -> Regex<(Substring, W, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .group(.capture, component().regex.root, reference.id)) } -public func capture( - @RegexBuilder _ component: () -> R, +public func capture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .groupTransform( @@ -3813,9 +3813,9 @@ public func capture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) throws -> NewCapture ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .groupTransform( @@ -3827,8 +3827,8 @@ public func tryCapture( - @RegexBuilder _ component: () -> R, +public func tryCapture( + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .groupTransform( @@ -3839,9 +3839,9 @@ public func tryCapture( +public func tryCapture( as reference: Reference, - @RegexBuilder _ component: () -> R, + @RegexComponentBuilder _ component: () -> R, transform: @escaping (Substring) -> NewCapture? ) -> Regex<(Substring, NewCapture, C0, C1, C2, C3, C4, C5, C6, C7, C8)> where R.Match == (W, C0, C1, C2, C3, C4, C5, C6, C7, C8) { .init(node: .groupTransform( diff --git a/Tests/RegexTests/AlgorithmsTests.swift b/Tests/RegexTests/AlgorithmsTests.swift index 7d1ade03e..d0d5dd768 100644 --- a/Tests/RegexTests/AlgorithmsTests.swift +++ b/Tests/RegexTests/AlgorithmsTests.swift @@ -122,7 +122,7 @@ class RegexConsumerTests: XCTestCase { } func testMatchReplace() { - func replaceTest( + func replaceTest( _ regex: R, input: String, result: String, diff --git a/Tests/RegexTests/RegexDSLTests.swift b/Tests/RegexTests/RegexDSLTests.swift index d78ff04e5..dbd7584dc 100644 --- a/Tests/RegexTests/RegexDSLTests.swift +++ b/Tests/RegexTests/RegexDSLTests.swift @@ -19,13 +19,13 @@ func dynCap( } class RegexDSLTests: XCTestCase { - func _testDSLCaptures( + func _testDSLCaptures( _ tests: (input: String, expectedCaptures: CaptureType?)..., matchType: CaptureType.Type, _ equivalence: (CaptureType, CaptureType) -> Bool, file: StaticString = #file, line: UInt = #line, - @RegexBuilder _ content: () -> Content + @RegexComponentBuilder _ content: () -> Content ) throws { let regex = Regex(content()) for (input, maybeExpectedCaptures) in tests {