Skip to content

Commit 8a6d075

Browse files
authored
Merge pull request #105 from kborowinski/patch-5
Add -shl and -shr to bitwise operators
2 parents 5d9c5b5 + f898bdb commit 8a6d075

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

PowerShellSyntax.tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
</dict>
312312
<dict>
313313
<key>match</key>
314-
<string>(?&lt;!\w)-(?i:band|bor|bnot|bxor)(?!\p{L})</string>
314+
<string>(?&lt;!\w)-(?i:band|bor|bnot|bxor|shl|shr)(?!\p{L})</string>
315315
<key>name</key>
316316
<string>keyword.operator.bitwise.powershell</string>
317317
</dict>

spec/testfiles/syntax_test_TheBigTestFile.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,14 @@ $x = $y -band $x
10041004
$z = -bnot $x
10051005
# ^ keyword.operator.assignment.powershell
10061006
# ^ keyword.operator.bitwise.powershell
1007+
$l = 1 -shl 10
1008+
# ^ keyword.operator.assignment.powershell
1009+
# ^ ^^ constant.numeric.integer.powershell
1010+
# ^ keyword.operator.bitwise.powershell
1011+
$r = 10 -shr 1
1012+
# ^ keyword.operator.assignment.powershell
1013+
# ^^ ^ constant.numeric.integer.powershell
1014+
# ^ keyword.operator.bitwise.powershell
10071015
$k = $y -xor $b
10081016
# ^ keyword.operator.assignment.powershell
10091017
# ^ keyword.operator.logical.powershell

0 commit comments

Comments
 (0)