@@ -2775,11 +2775,10 @@ extension RegexTests {
2775
2775
diagnosticTest ( #"(?^"# , . expected( " ) " ) )
2776
2776
diagnosticTest ( #"(?^i"# , . expected( " ) " ) )
2777
2777
2778
- // TODO: These errors could be better.
2779
- diagnosticTest ( #"(?y)"# , . expected( " { " ) , . expected( " g " ) , . expected( " } " ) , unsupported: true )
2780
- diagnosticTest ( #"(?y{)"# , . expected( " g " ) , . expected( " } " ) , unsupported: true )
2778
+ diagnosticTest ( #"(?y)"# , . expected( " { " ) , unsupported: true )
2779
+ diagnosticTest ( #"(?y{)"# , . unknownTextSegmentMatchingOption( " ) " ) , . expected( " } " ) , . expected( " ) " ) , unsupported: true )
2781
2780
diagnosticTest ( #"(?y{g)"# , . expected( " } " ) , unsupported: true )
2782
- diagnosticTest ( #"(?y{x})"# , . expected ( " g " ) , . expected ( " } " ) , . invalidMatchingOption ( " } " ) , unsupported: true )
2781
+ diagnosticTest ( #"(?y{x})"# , . unknownTextSegmentMatchingOption ( " x " ) , unsupported: true )
2783
2782
2784
2783
diagnosticTest ( #"(?P"# , . expected( " ) " ) )
2785
2784
diagnosticTest ( #"(?R"# , . expected( " ) " ) , unsupported: true )
@@ -3022,18 +3021,17 @@ extension RegexTests {
3022
3021
diagnosticTest ( #"(?k)"# , . unknownGroupKind( " ?k " ) )
3023
3022
diagnosticTest ( #"(?P#)"# , . invalidMatchingOption( " # " ) )
3024
3023
3025
- // TODO: We shouldn't emit the expected closing delimiter here and elsewhere.
3026
- diagnosticTest ( #"(?<#>)"# , . expected( " > " ) , . identifierMustBeAlphaNumeric( . groupName) )
3024
+ diagnosticTest ( #"(?<#>)"# , . identifierMustBeAlphaNumeric( . groupName) )
3027
3025
diagnosticTest ( #"(?'1A')"# , . identifierCannotStartWithNumber( . groupName) )
3028
3026
3029
3027
// TODO: It might be better if tried to consume up to the closing `'` and
3030
3028
// diagnosed an invalid group name based on that.
3031
3029
diagnosticTest ( #"(?'abc ')"# , . expected( " ' " ) )
3032
3030
3033
- diagnosticTest ( " (?'🔥') " , . identifierMustBeAlphaNumeric( . groupName) , . expected ( " ' " ) )
3031
+ diagnosticTest ( " (?'🔥') " , . identifierMustBeAlphaNumeric( . groupName) )
3034
3032
3035
3033
diagnosticTest ( #"(?'-')"# , . expectedIdentifier( . groupName) , unsupported: true )
3036
- diagnosticTest ( #"(?'--')"# , . identifierMustBeAlphaNumeric( . groupName) , . expected ( " ' " ) , unsupported: true )
3034
+ diagnosticTest ( #"(?'--')"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3037
3035
diagnosticTest ( #"(?'a-b-c')"# , . expected( " ' " ) , unsupported: true )
3038
3036
3039
3037
diagnosticTest ( " (?x)(? : ) " , . unknownGroupKind( " ? " ) )
@@ -3114,12 +3112,12 @@ extension RegexTests {
3114
3112
diagnosticTest ( #"\g{0}"# , . cannotReferToWholePattern)
3115
3113
diagnosticTest ( #"(?(0))"# , . cannotReferToWholePattern, unsupported: true )
3116
3114
3117
- diagnosticTest ( #"(?&&)"# , . identifierMustBeAlphaNumeric( . groupName) , . unbalancedEndOfGroup , . expected ( " ) " ) , unsupported: true )
3118
- diagnosticTest ( #"(?&-1)"# , . identifierMustBeAlphaNumeric( . groupName) , . unbalancedEndOfGroup , . expected ( " ) " ) , unsupported: true )
3119
- diagnosticTest ( #"(?P>+1)"# , . identifierMustBeAlphaNumeric( . groupName) , . unbalancedEndOfGroup , . expected ( " ) " ) , unsupported: true )
3120
- diagnosticTest ( #"(?P=+1)"# , . identifierMustBeAlphaNumeric( . groupName) , . unbalancedEndOfGroup , . expected ( " ) " ) , unsupported: true )
3121
- diagnosticTest ( #"\k'#'"# , . identifierMustBeAlphaNumeric( . groupName) , . expected ( " ' " ) , unsupported: true )
3122
- diagnosticTest ( #"(?&#)"# , . identifierMustBeAlphaNumeric( . groupName) , . unbalancedEndOfGroup , . expected ( " ) " ) , unsupported: true )
3115
+ diagnosticTest ( #"(?&&)"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3116
+ diagnosticTest ( #"(?&-1)"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3117
+ diagnosticTest ( #"(?P>+1)"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3118
+ diagnosticTest ( #"(?P=+1)"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3119
+ diagnosticTest ( #"\k'#'"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3120
+ diagnosticTest ( #"(?&#)"# , . identifierMustBeAlphaNumeric( . groupName) , unsupported: true )
3123
3121
3124
3122
diagnosticTest ( #"(?P>1)"# , . identifierCannotStartWithNumber( . groupName) , unsupported: true )
3125
3123
diagnosticTest ( #"\k{1}"# , . identifierCannotStartWithNumber( . groupName) , . invalidNamedReference( " 1 " ) )
0 commit comments