Tree sitter: A lot of detail gone from RegExp (#245427)

Fixes #244572
This commit is contained in:
Alex Ross
2025-04-03 12:08:00 +02:00
committed by GitHub
parent 0758530676
commit dea304ea91
2 changed files with 56 additions and 46 deletions
@@ -57,21 +57,21 @@
},
{
"c": "\\\\",
"t": "string.regexp.ts",
"t": "string.regexp.ts constant.character.escape.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #EE0000",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969",
"dark_modern": "string.regexp: #D16969",
"hc_light": "string.regexp: #811F3F",
"light_modern": "string.regexp: #811F3F"
"hc_black": "constant.character: #569CD6",
"dark_modern": "constant.character.escape: #D7BA7D",
"hc_light": "constant.character.escape: #EE0000",
"light_modern": "constant.character.escape: #EE0000"
}
},
{
"c": "\\x",
"t": "string.regexp.ts internal.regexp constant.character.numeric.regexp",
"t": "string.regexp.ts constant.character.escape.regexp internal.regexp constant.character.numeric.regexp",
"r": {
"dark_plus": "constant.character: #569CD6",
"light_plus": "constant.character: #0000FF",
@@ -253,16 +253,16 @@
},
{
"c": "\\-",
"t": "string.regexp.ts",
"t": "string.regexp.ts constant.character.escape.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #EE0000",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969",
"dark_modern": "string.regexp: #D16969",
"hc_light": "string.regexp: #811F3F",
"light_modern": "string.regexp: #811F3F"
"hc_black": "constant.character: #569CD6",
"dark_modern": "constant.character.escape: #D7BA7D",
"hc_light": "constant.character.escape: #EE0000",
"light_modern": "constant.character.escape: #EE0000"
}
},
{
@@ -393,30 +393,30 @@
},
{
"c": "\\]",
"t": "string.regexp.ts",
"t": "string.regexp.ts constant.character.escape.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #EE0000",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969",
"dark_modern": "string.regexp: #D16969",
"hc_light": "string.regexp: #811F3F",
"light_modern": "string.regexp: #811F3F"
"hc_black": "constant.character: #569CD6",
"dark_modern": "constant.character.escape: #D7BA7D",
"hc_light": "constant.character.escape: #EE0000",
"light_modern": "constant.character.escape: #EE0000"
}
},
{
"c": "\\\\",
"t": "string.regexp.ts",
"t": "string.regexp.ts constant.character.escape.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #EE0000",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969",
"dark_modern": "string.regexp: #D16969",
"hc_light": "string.regexp: #811F3F",
"light_modern": "string.regexp: #811F3F"
"hc_black": "constant.character: #569CD6",
"dark_modern": "constant.character.escape: #D7BA7D",
"hc_light": "constant.character.escape: #EE0000",
"light_modern": "constant.character.escape: #EE0000"
}
},
{
@@ -659,30 +659,30 @@
},
{
"c": "\\/",
"t": "string.regexp.ts",
"t": "string.regexp.ts constant.character.escape.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #EE0000",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969",
"dark_modern": "string.regexp: #D16969",
"hc_light": "string.regexp: #811F3F",
"light_modern": "string.regexp: #811F3F"
"hc_black": "constant.character: #569CD6",
"dark_modern": "constant.character.escape: #D7BA7D",
"hc_light": "constant.character.escape: #EE0000",
"light_modern": "constant.character.escape: #EE0000"
}
},
{
"c": "\\/",
"t": "string.regexp.ts",
"t": "string.regexp.ts constant.character.escape.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #EE0000",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969",
"dark_modern": "string.regexp: #D16969",
"hc_light": "string.regexp: #811F3F",
"light_modern": "string.regexp: #811F3F"
"hc_black": "constant.character: #569CD6",
"dark_modern": "constant.character.escape: #D7BA7D",
"hc_light": "constant.character.escape: #EE0000",
"light_modern": "constant.character.escape: #EE0000"
}
},
{
@@ -1625,7 +1625,7 @@
},
{
"c": "\\u",
"t": "string.regexp.ts internal.regexp constant.character.numeric.regexp",
"t": "string.regexp.ts constant.character.escape.regexp internal.regexp constant.character.numeric.regexp",
"r": {
"dark_plus": "constant.character: #569CD6",
"light_plus": "constant.character: #0000FF",
@@ -43,6 +43,10 @@
(boundary_assertion)
] @keyword.control.anchor.regexp
(class_character) @constant.character-class.regexp
(identity_escape) @constant.character.escape.regexp
[
((identity_escape) @internal.regexp (#match? @internal.regexp "\\[^ux]"))
] @constant.character.escape.regexp
@@ -67,6 +71,14 @@
(pattern_character) @constant.character.numeric.regexp
) @constant.character.numeric.regexp
(
((identity_escape) @internal.regexp (#eq? @internal.regexp "\\x"))
.
(class_character) @constant.character.numeric.regexp
.
(class_character) @constant.character.numeric.regexp
) @constant.character.numeric.regexp
[
(character_class_escape)
(control_escape)
@@ -92,5 +104,3 @@
"^" @keyword.operator.negation.regexp
(class_range "-" @constant.other.character-class.range.regexp)
])
(class_character) @constant.character-class.regexp