Skip to content

Commit 17fbeac

Browse files
committed
Fix character-class invalid escapes
1 parent cdae55e commit 17fbeac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

syntaxes/regex.tmLanguage.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,11 +1033,15 @@
10331033
{
10341034
"match": "\\G\\\\[bfnrt]",
10351035
"name": "constant.character.escape.tm"
1036+
},
1037+
{
1038+
"match": "\\\\.?",
1039+
"name": "invalid.illegal.tm regex"
10361040
}
10371041
]
10381042
},
10391043
{
1040-
"match": "\\\\.?|[\"\\x00-\\x1F\\x7F]",
1044+
"match": "[\"\\x00-\\x1F\\x7F]",
10411045
"name": "invalid.illegal.tm regex"
10421046
}
10431047
]
@@ -1166,7 +1170,7 @@
11661170
},
11671171
"character-class-posix": {
11681172
"comment": "oniguruma checks for ending bracket `:]` accounting for escapes. https://github.com/kkos/oniguruma/blob/v6.9.8/src/regparse.c#L5393-L5416",
1169-
"begin": "\\G(?=\\[:(?>[^]:\\\\\"]++|:+(?!])|\\\\{1,3}.?)*+:])",
1173+
"begin": "\\G(?=\\[:(?>[^]:\\\\\"]++|:+(?!])|\\\\{1,2}.?)*+:])",
11701174
"end": "(?!\\G)",
11711175
"name": "meta.character-class.posix.tm",
11721176
"patterns": [

0 commit comments

Comments
 (0)