Skip to content

Commit

Permalink
Fix invalid lookaround group nesting in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RedCMD committed Jan 10, 2024
1 parent 4815c44 commit 9a82bc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions syntaxes/json.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
"scopeName": "source.json.textmate",
"name": "JSON TextMate",
"injections": {
"L:capture-group-lookbehind -capture-group-modify-extended character-class comment": {
"L:capture-group-lookbehind -capture-group-modify-extended -character-class -comment": {
"patterns": [
{ "include": "source.syntax.regexp.tmLanguage#capture-group-lookbehind-invalid" },
{ "include": "source.syntax.regexp.tmLanguage#absent-invalid" }
]
},
"L:capture-group-lookbehind-extended -capture-group-modify character-class comment": {
"L:capture-group-lookbehind-extended -capture-group-modify -character-class -comment": {
"patterns": [
{ "include": "source.syntax.regexp.tmLanguage#capture-group-lookbehind-invalid-extended" },
{ "include": "source.syntax.regexp.tmLanguage#absent-invalid-extended" }
]
},
"L:capture-group-negative-lookbehind -capture-group-modify-extended character-class comment": {
"L:capture-group-negative-lookbehind -capture-group-modify-extended -character-class -comment": {
"patterns": [
{ "include": "source.syntax.regexp.tmLanguage#capture-group-negative-lookbehind-invalid" },
{ "include": "source.syntax.regexp.tmLanguage#absent-invalid" }
]
},
"L:capture-group-negative-lookbehind-extended -capture-group-modify character-class comment": {
"L:capture-group-negative-lookbehind-extended -capture-group-modify -character-class -comment": {
"patterns": [
{ "include": "source.syntax.regexp.tmLanguage#capture-group-negative-lookbehind-invalid-extended" },
{ "include": "source.syntax.regexp.tmLanguage#absent-invalid-extended" }
Expand Down
10 changes: 5 additions & 5 deletions syntaxes/regex.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
"scopeName": "source.syntax.regexp.tmLanguage",
"name": "TextMate Language Regex",
"injections": {
"L:capture-group-lookbehind -capture-group-modify-extended character-class comment": {
"L:capture-group-lookbehind -capture-group-modify-extended -character-class -comment": {
"patterns": [
{ "include": "#capture-group-lookbehind-invalid" },
{ "include": "#absent-invalid" }
]
},
"L:capture-group-lookbehind-extended -capture-group-modify character-class comment": {
"L:capture-group-lookbehind-extended -capture-group-modify -character-class -comment": {
"patterns": [
{ "include": "#capture-group-lookbehind-invalid-extended" },
{ "include": "#absent-invalid-extended" }
]
},
"L:capture-group-negative-lookbehind -capture-group-modify-extended character-class comment": {
"L:capture-group-negative-lookbehind -capture-group-modify-extended -character-class -comment": {
"patterns": [
{ "include": "#capture-group-negative-lookbehind-invalid" },
{ "include": "#absent-invalid" }
]
},
"L:capture-group-negative-lookbehind-extended -capture-group-modify character-class comment": {
"L:capture-group-negative-lookbehind-extended -capture-group-modify -character-class -comment": {
"patterns": [
{ "include": "#capture-group-negative-lookbehind-invalid-extended" },
{ "include": "#absent-invalid-extended" }
Expand Down Expand Up @@ -211,7 +211,7 @@
"patterns": [ { "include": "#$self-extended" } ]
},
"capture-group-lookbehind-test": {
"match": "(?x) # Doesn't work 100% yet. Turning extended mode on before a look-around, then turning it off again inside the group does not turn it off inside the following invalid capture groups \n (?<! (?-x) ( ##\n) (?: ##\n) (?= ##\n) (?! ##\n) (?<= ##\n) (?<! ##\n) (?<= ( ##\n) (?: ##\n) (?= ##\n) (?! ##\n) (?<= ##\n) (?<! ##\n) ##\n) ##\n) (?<= ( ##\n) (?: ##\n) (?= ##\n) (?! ##\n) (?<= ##\n) (?<! ##\n) (?<! ( ##\n) (?: ##\n) (?= ##\n) (?! ##\n) (?<= ##\n) (?<! ##\n) ##\n) ##\n)"
"match": "(?x) # Doesn't work 100% yet. Turning extended mode on before a look-around, then turning it off again inside the group does not turn it off inside the following invalid capture groups \n (?<! (?-x) ( ##\n) (?: ##\n) (?= ##\n) (?! ##\n) (?<= ##\n) (?<! ##\n) (?<= ( ##\n) (?: ##\n) (?= ##\n) (?! ##\n) (?<= ##\n) (?<! ##\n) ##\n) ##\n) (?<= ( ##\n) (?: ##\n) (?= ##\n) (?! ##\n) (?<= ##\n) (?<! ##\n) (?<! ( ##\n) (?: ##\n) (?= ##(?= #\n) (?! ##\n) (?<= ##\n) (?<! ##\n) ##\n) ##\n)"
},
"capture-group-lookbehind": {
"comment": "(?<=...)",
Expand Down

0 comments on commit 9a82bc0

Please sign in to comment.