@@ -2802,11 +2802,10 @@ extension RegexTests {
28022802 diagnosticTest ( #"(?^"# , . expected( " ) " ) )
28032803 diagnosticTest ( #"(?^i"# , . expected( " ) " ) )
28042804
2805- // TODO: These errors could be better.
2806- diagnosticTest ( #"(?y)"# , . expected( " { " ) , . expected( " g " ) , . expected( " } " ) , unsupported: true )
2807- diagnosticTest ( #"(?y{)"# , . expected( " g " ) , . expected( " } " ) , unsupported: true )
2805+ diagnosticTest ( #"(?y)"# , . expected( " { " ) , unsupported: true )
2806+ diagnosticTest ( #"(?y{)"# , . unknownTextSegmentMatchingOption( " ) " ) , . expected( " } " ) , . expected( " ) " ) , unsupported: true )
28082807 diagnosticTest ( #"(?y{g)"# , . expected( " } " ) , unsupported: true )
2809- diagnosticTest ( #"(?y{x})"# , . expected ( " g " ) , . expected ( " } " ) , . invalidMatchingOption ( " } " ) , unsupported: true )
2808+ diagnosticTest ( #"(?y{x})"# , . unknownTextSegmentMatchingOption ( " x " ) , unsupported: true )
28102809
28112810 diagnosticTest ( #"(?P"# , . expected( " ) " ) )
28122811 diagnosticTest ( #"(?R"# , . expected( " ) " ) , unsupported: true )
@@ -3086,18 +3085,17 @@ extension RegexTests {
30863085 diagnosticTest ( #"(?k)"# , . unknownGroupKind( " ?k " ) )
30873086 diagnosticTest ( #"(?P#)"# , . invalidMatchingOption( " # " ) )
30883087
3089- // TODO: We shouldn't emit the expected closing delimiter here and elsewhere.
3090- diagnosticTest ( #"(?<#>)"# , . expected( " > " ) , . identifierMustBeAlphaNumeric( . groupName) )
3088+ diagnosticTest ( #"(?<#>)"# , . identifierMustBeAlphaNumeric( . groupName) )
30913089 diagnosticTest ( #"(?'1A')"# , . identifierCannotStartWithNumber( . groupName) )
30923090
30933091 // TODO: It might be better if tried to consume up to the closing `'` and
30943092 // diagnosed an invalid group name based on that.
30953093 diagnosticTest ( #"(?'abc ')"# , . expected( " ' " ) )
30963094
3097- diagnosticTest ( " (?'🔥') " , . identifierMustBeAlphaNumeric( . groupName) , . expected ( " ' " ) )
3095+ diagnosticTest ( " (?'🔥') " , . identifierMustBeAlphaNumeric( . groupName) )
30983096
30993097 diagnosticTest ( #"(?'-')"# , . expectedIdentifier( . groupName) , unsupported: true )
3100- diagnosticTest ( #"(?'--')"# , . identifierMustBeAlphaNumeric( . groupName) , . expected ( " ' " ) , unsupported: true )
3098+ diagnosticTest ( #"(?'--')"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
31013099 diagnosticTest ( #"(?'a-b-c')"# , . expected( " ' " ) , unsupported: true )
31023100
31033101 diagnosticTest ( " (?x)(? : ) " , . unknownGroupKind( " ? " ) )
@@ -3178,12 +3176,12 @@ extension RegexTests {
31783176 diagnosticTest ( #"\g{0}"# , . cannotReferToWholePattern)
31793177 diagnosticTest ( #"(?(0))"# , . cannotReferToWholePattern, unsupported: true )
31803178
3181- diagnosticTest ( #"(?&&)"# , . identifierMustBeAlphaNumeric( . groupName) , . unbalancedEndOfGroup , . expected ( " ) " ) , unsupported: true )
3182- diagnosticTest ( #"(?&-1)"# , . identifierMustBeAlphaNumeric( . groupName) , . unbalancedEndOfGroup , . expected ( " ) " ) , unsupported: true )
3183- diagnosticTest ( #"(?P>+1)"# , . identifierMustBeAlphaNumeric( . groupName) , . unbalancedEndOfGroup , . expected ( " ) " ) , unsupported: true )
3184- diagnosticTest ( #"(?P=+1)"# , . identifierMustBeAlphaNumeric( . groupName) , . unbalancedEndOfGroup , . expected ( " ) " ) , unsupported: true )
3185- diagnosticTest ( #"\k'#'"# , . identifierMustBeAlphaNumeric( . groupName) , . expected ( " ' " ) , unsupported: true )
3186- diagnosticTest ( #"(?&#)"# , . identifierMustBeAlphaNumeric( . groupName) , . unbalancedEndOfGroup , . expected ( " ) " ) , unsupported: true )
3179+ diagnosticTest ( #"(?&&)"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3180+ diagnosticTest ( #"(?&-1)"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3181+ diagnosticTest ( #"(?P>+1)"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3182+ diagnosticTest ( #"(?P=+1)"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3183+ diagnosticTest ( #"\k'#'"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3184+ diagnosticTest ( #"(?&#)"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
31873185
31883186 diagnosticTest ( #"(?P>1)"# , . identifierCannotStartWithNumber( . groupName) , unsupported: true )
31893187 diagnosticTest ( #"\k{1}"# , . identifierCannotStartWithNumber( . groupName) , . invalidNamedReference( " 1 " ) )
0 commit comments