[Regex] Switch regex match to Swift tuples.

Typed captures no longer use ad-hoc nominal tuples. We use Swift native tuples instead. See apple/swift-experimental-string-processing#127.

Update checkout tag to dev/6.
This commit is contained in:
Richard Wei
2022-02-08 13:30:01 -08:00
parent 2b2dd23726
commit cf8e0fea12
12 changed files with 41 additions and 94 deletions

View File

@@ -47,7 +47,7 @@ RegexBasicTests.test("Captures") {
"""
let regex = '/([0-9A-F]+)(?:\.\.([0-9A-F]+))?\s+;\s+(\w+).*/'
// Test inferred type.
let _: Regex<Tuple4<Substring, Substring, Substring?, Substring>>.Type
let _: Regex<(Substring, Substring, Substring?, Substring)>.Type
= type(of: regex)
let match1 = input.expectMatch(regex)
expectEqual(input[...], input[match1.range])