C++: Remove single-quote named capture groups

This commit is contained in:
copilot-swe-agent[bot]
2026-07-23 10:10:15 +00:00
committed by GitHub
parent d3b51dd3a3
commit dda4b00922
4 changed files with 0 additions and 29 deletions

View File

@@ -630,11 +630,6 @@ abstract class RegExp extends StringLiteral {
nameEnd = min(int i | i > start + 3 and this.getChar(i) = ">") and
end = nameEnd + 1
)
or
this.getChar(start + 2) = "'" and
exists(int nameEnd |
nameEnd = min(int i | i > start + 2 and this.getChar(i) = "'") and end = nameEnd + 1
)
)
}

View File

@@ -44,10 +44,6 @@
#-----| [RegExpConstant, RegExpNormalChar] b
#-----| [RegExpConstant, RegExpNormalChar] f
#-----| [RegExpConstant, RegExpNormalChar] o
#-----| [RegExpCharacterClassEscape] \w
#-----| [RegExpConstant, RegExpNormalChar] :
@@ -187,10 +183,6 @@
#-----| 1 -> [RegExpPlus] b+
#-----| 2 -> [RegExpBackRef] \1
#-----| [RegExpSequence] fo+
#-----| 0 -> [RegExpConstant, RegExpNormalChar] f
#-----| 1 -> [RegExpPlus] o+
#-----| [RegExpSequence] (?::+)\w
#-----| 0 -> [RegExpGroup] (?::+)
#-----| 1 -> [RegExpCharacterClassEscape] \w
@@ -263,9 +255,6 @@
#-----| [RegExpGroup] (a+)
#-----| 0 -> [RegExpPlus] a+
#-----| [RegExpGroup] (?'foo'fo+)
#-----| 0 -> [RegExpSequence] fo+
#-----| [RegExpGroup] (?<id>\w+)
#-----| 0 -> [RegExpPlus] \w+
@@ -384,9 +373,6 @@
#-----| [RegExpPlus] b+
#-----| 0 -> [RegExpConstant, RegExpNormalChar] b
#-----| [RegExpPlus] o+
#-----| 0 -> [RegExpConstant, RegExpNormalChar] o
#-----| [RegExpPlus] \w+
#-----| 0 -> [RegExpCharacterClassEscape] \w

View File

@@ -60,7 +60,6 @@ std::regex r_grp4("(?::+)\\w"); // Non-capturing group matching colons
// Named groups
std::regex r_ng1("(?<id>\\w+)");
std::regex r_ng2("(?'foo'fo+)"); // single-quote named-group form
// Backreferences
std::regex r_bref1("(a+)b+\\1");

View File

@@ -1,9 +1,7 @@
groupName
| file://:0:0:0:0 | (?'foo'fo+) | foo |
| file://:0:0:0:0 | (?<id>\\w+) | id |
| file://:0:0:0:0 | (?<qux>q+) | qux |
groupNumber
| file://:0:0:0:0 | (?'foo'fo+) | 1 |
| file://:0:0:0:0 | (a+) | 1 |
| file://:0:0:0:0 | (a\|b\|cd) | 1 |
| file://:0:0:0:0 | (foo) | 1 |
@@ -16,7 +14,6 @@ term
| file://:0:0:0:0 | 3 | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | 9 | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | !a | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | (?'foo'fo+) | RegExpGroup |
| file://:0:0:0:0 | (?::+) | RegExpGroup |
| file://:0:0:0:0 | (?::+)\\w | RegExpSequence |
| file://:0:0:0:0 | (?<id>\\w+) | RegExpGroup |
@@ -156,16 +153,12 @@ term
| file://:0:0:0:0 | f | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | f | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | f | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | f | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | fo | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | fo(o\|b)ar | RegExpSequence |
| file://:0:0:0:0 | fo+ | RegExpSequence |
| file://:0:0:0:0 | foo | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | foo | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | foo\|bar | RegExpAlt |
| file://:0:0:0:0 | o | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | o | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | o+ | RegExpPlus |
| file://:0:0:0:0 | o\|b | RegExpAlt |
| file://:0:0:0:0 | q | RegExpConstant,RegExpNormalChar |
| file://:0:0:0:0 | q+ | RegExpPlus |
@@ -248,10 +241,8 @@ regExpNormalCharValue
| file://:0:0:0:0 | f | f |
| file://:0:0:0:0 | f | f |
| file://:0:0:0:0 | f | f |
| file://:0:0:0:0 | f | f |
| file://:0:0:0:0 | fo | fo |
| file://:0:0:0:0 | foo | foo |
| file://:0:0:0:0 | foo | foo |
| file://:0:0:0:0 | o | o |
| file://:0:0:0:0 | o | o |
| file://:0:0:0:0 | q | q |