Skip to content

Commit 5426265

Browse files
committed
Avoid variable length lookbehind
1 parent 11731b4 commit 5426265

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
To **build and test** install Node.js do the following:
44

55
* Run `npm install` to install any dependencies.
6-
* Run `gulp` to build and run tests.
6+
* Run `npm run compile` to build and run tests.
77

88
Output grammars are output in the `grammars\` directory.
99

Diff for: grammars/csharp.tmLanguage

+1-1
Original file line numberDiff line numberDiff line change
@@ -5207,7 +5207,7 @@
52075207
<key>conditional-operator</key>
52085208
<dict>
52095209
<key>begin</key>
5210-
<string>(?&lt;!\?\s*)\?(?!\?|\.|\[)</string>
5210+
<string>\?(?!\s*[?.\[]|\s*$)</string>
52115211
<key>beginCaptures</key>
52125212
<dict>
52135213
<key>0</key>

Diff for: grammars/csharp.tmLanguage.cson

+1-1
Original file line numberDiff line numberDiff line change
@@ -3159,7 +3159,7 @@ repository:
31593159
}
31603160
]
31613161
"conditional-operator":
3162-
begin: "(?<!\\?\\s*)\\?(?!\\?|\\.|\\[)"
3162+
begin: "\\?(?!\\s*[?.\\[]|\\s*$)"
31633163
beginCaptures:
31643164
"0":
31653165
name: "keyword.operator.conditional.question-mark.cs"

Diff for: src/csharp.tmLanguage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2035,7 +2035,7 @@ repository:
20352035
# Only match ? if:
20362036
# 1. There isn't a preceding or trailing ? (null-coalescing operator)
20372037
# 2. There isn't a trailing . or [ (null-conditional operator)
2038-
begin: (?<!\?\s*)\?(?!\?|\.|\[)
2038+
begin: \?(?!\s*[?.\[]|\s*$)
20392039
beginCaptures:
20402040
'0': { name: keyword.operator.conditional.question-mark.cs }
20412041
end: ':'

0 commit comments

Comments
 (0)