Skip to content

Commit

Permalink
Avoid variable length lookbehind
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 committed Sep 6, 2021
1 parent 11731b4 commit db92540
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
To **build and test** install Node.js do the following:

* Run `npm install` to install any dependencies.
* Run `gulp` to build and run tests.
* Run `npm run compile` to build and run tests.

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

Expand Down
2 changes: 1 addition & 1 deletion grammars/csharp.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -5207,7 +5207,7 @@
<key>conditional-operator</key>
<dict>
<key>begin</key>
<string>(?&lt;!\?\s*)\?(?!\?|\.|\[)</string>
<string>\?(?!\?|\.|\[)|(?&lt;!\?)\s+\?(?!\?|\.|\[)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
Expand Down
2 changes: 1 addition & 1 deletion grammars/csharp.tmLanguage.cson
Original file line number Diff line number Diff line change
Expand Up @@ -3159,7 +3159,7 @@ repository:
}
]
"conditional-operator":
begin: "(?<!\\?\\s*)\\?(?!\\?|\\.|\\[)"
begin: "\\?(?!\\?|\\.|\\[)|(?<!\\?)\\s+\\?(?!\\?|\\.|\\[)"
beginCaptures:
"0":
name: "keyword.operator.conditional.question-mark.cs"
Expand Down
2 changes: 1 addition & 1 deletion src/csharp.tmLanguage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,7 @@ repository:
# Only match ? if:
# 1. There isn't a preceding or trailing ? (null-coalescing operator)
# 2. There isn't a trailing . or [ (null-conditional operator)
begin: (?<!\?\s*)\?(?!\?|\.|\[)
begin: \?(?!\?|\.|\[)|(?<!\?)\s+\?(?!\?|\.|\[)
beginCaptures:
'0': { name: keyword.operator.conditional.question-mark.cs }
end: ':'
Expand Down

0 comments on commit db92540

Please sign in to comment.