Skip to content

Commit 7d25540

Browse files
committed
various little changes/tweaks
1 parent 76bb7e5 commit 7d25540

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

PowerShellSyntax.tmLanguage

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@
512512
<key>match</key>
513513
<string>;</string>
514514
<key>name</key>
515-
<string>punctuation.terminator.statement.powershell</string>
515+
<string>punctuation.terminator.assignment.enum-member.powershell</string>
516516
</dict>
517517
<dict>
518518
<key>begin</key>
@@ -1022,7 +1022,7 @@
10221022
<key>comment</key>
10231023
<string>-parallel parameter can only be used in a workflow, consider using meta scopes, and an injection to properly catch this</string>
10241024
<key>match</key>
1025-
<string>(?i:[\x{2013}-\x{2015}-]parallel)(?:(:)?|(?![^\s{(,;&amp;|)}]))</string>
1025+
<string>(?i:[\x{2013}-\x{2015}-]parallel)(?:(:)|(?=[\s\[{(,;&amp;|)}]))</string>
10261026
<key>beginCaptures</key>
10271027
<dict>
10281028
<key>1</key>
@@ -1834,7 +1834,7 @@
18341834
<array>
18351835
<dict>
18361836
<key>match</key>
1837-
<string>((?i:[\x{2013}-\x{2015}-](regex|wildcard|exact|casesensitive)))(?:(:)?|(?![^\s{(,;&amp;|)}]))</string>
1837+
<string>((?i:[\x{2013}-\x{2015}-](regex|wildcard|exact|casesensitive)))(?:(:)|(?=[\s\[{(,;&amp;|)}]))</string>
18381838
<key>captures</key>
18391839
<dict>
18401840
<key>1</key>
@@ -1853,7 +1853,7 @@
18531853
<key>comment</key>
18541854
<string>-file is special case, needs file argument, no condition expression</string>
18551855
<key>begin</key>
1856-
<string>((?i:[\x{2013}-\x{2015}-]file))(?:(:)?|(?![^\s{(,;&amp;|)}]))</string>
1856+
<string>((?i:[\x{2013}-\x{2015}-]file))(?:(:)|(?=[\s\[{(,;&amp;|)}]))</string>
18571857
<key>beginCaptures</key>
18581858
<dict>
18591859
<key>1</key>
@@ -2255,7 +2255,7 @@
22552255
<key>comment</key>
22562256
<string>-supportedcommand is special case, array of arguments</string>
22572257
<key>begin</key>
2258-
<string>((?i:[\x{2013}-\x{2015}-]supportedcommand))(?:(:)?|(?![^\s{(,;&amp;|)}]))</string>
2258+
<string>((?i:[\x{2013}-\x{2015}-]supportedcommand))(?:(:)|(?=[\s\[{(,;&amp;|)}]))</string>
22592259
<key>beginCaptures</key>
22602260
<dict>
22612261
<key>1</key>
@@ -2557,12 +2557,8 @@
25572557
<key>patterns</key>
25582558
<array>
25592559
<dict>
2560-
<key>comment</key>
2561-
<string>`||` and `&amp;&amp;` conditional terminators are reserved.</string>
2562-
<key>match</key>
2563-
<string>\|\||&amp;&amp;</string>
2564-
<key>name</key>
2565-
<string>invalid.reserved.powershell</string>
2560+
<key>include</key>
2561+
<string>#terminators</string>
25662562
</dict>
25672563
<dict>
25682564
<key>comment</key>
@@ -3030,7 +3026,9 @@
30303026
</dict>
30313027
<dict>
30323028
<key>match</key>
3033-
<string>([\x{2013}-\x{2015}-]\p{L}\w*)(:)?</string>
3029+
<string>([\x{2013}-\x{2015}-]\p{L}[^\s\[{(,;&amp;|)}'"\x{2018}-\x{201E}]*)(?:(:)|(?=[\s\[{(,;&amp;|)}]))</string>
3030+
<key>old match</key>
3031+
<string>([\x{2013}-\x{2015}-]\p{L}[\w~`!@#$%^*&lt;?&gt;\]\\/=+-]*)(?:(:)|(?=[\s\[{(,;&amp;|)}]))</string>
30343032
<key>captures</key>
30353033
<dict>
30363034
<key>1</key>
@@ -3126,6 +3124,12 @@
31263124
<key>include</key>
31273125
<string>#operators</string>
31283126
</dict>
3127+
<dict>
3128+
<key>match</key>
3129+
<string>`\n</string>
3130+
<key>name</key>
3131+
<string>constant.character.escape.powershell</string>
3132+
</dict>
31293133
<dict>
31303134
<key>ignore</key>
31313135
<string>`</string>
@@ -4682,7 +4686,7 @@
46824686
</dict>
46834687
<dict>
46844688
<key>match</key>
4685-
<string>(?i)(?:(?:cmdletbinding|alias|flags|outputtype|parameter|validate(?:not(?:null(?:orempty)?)|count|set|script|range|pattern|length)|allow(?:null|empty(?:collection|string))|supportswildcards|dsc(?:resource|property))(?![.\w+`-]))</string>
4689+
<string>(?i)(?:(?:cmdletbinding|alias|flags|outputtype|parameter|validate(?:not(?:null(?:orempty)?)|count|set|script|range|pattern|length)|allow(?:null|empty(?:collection|string))|supportswildcards|dsc(?:resource|property)|psdefaultvalue)(?![.\w+`-]))</string>
46864690
<key>name</key>
46874691
<string>support.function.attribute.powershell</string>
46884692
</dict>
@@ -5127,12 +5131,6 @@
51275131
<true/>
51285132
<key>patterns</key>
51295133
<array>
5130-
<dict>
5131-
<key>match</key>
5132-
<string>`\n</string>
5133-
<key>name</key>
5134-
<string>constant.character.escape.powershell</string>
5135-
</dict>
51365134
<dict>
51375135
<key>comment</key>
51385136
<string>useless escape, and doesn't count as a token</string>
@@ -6130,10 +6128,10 @@
61306128
</dict>
61316129
<dict>
61326130
<key>begin</key>
6133-
<string>=</string>
6131+
<string>(=)\n?</string>
61346132
<key>beginCaptures</key>
61356133
<dict>
6136-
<key>0</key>
6134+
<key>1</key>
61376135
<dict>
61386136
<key>name</key>
61396137
<string>keyword.operator.assignment.hashtable-member.powershell</string>
@@ -6143,15 +6141,21 @@
61436141
<string>(?=[;}\n])</string>
61446142
<key>patterns</key>
61456143
<array>
6144+
<dict>
6145+
<key>include</key>
6146+
<string>#advanceToToken</string>
6147+
</dict>
61466148
<dict>
61476149
<key>include</key>
61486150
<string>#command_mode</string>
61496151
</dict>
61506152
</array>
61516153
</dict>
61526154
<dict>
6153-
<key>include</key>
6154-
<string>#terminators</string>
6155+
<key>match</key>
6156+
<string>;</string>
6157+
<key>name</key>
6158+
<string>punctuation.terminator.assignment.hashtable-member.powershell</string>
61556159
</dict>
61566160
<dict>
61576161
<key>include</key>
@@ -6577,19 +6581,11 @@
65776581
<array>
65786582
<dict>
65796583
<key>comment</key>
6580-
<string>`;` resume's in statement mode.</string>
6581-
<key>match</key>
6582-
<string>;</string>
6583-
<key>name</key>
6584-
<string>punctuation.terminator.statement.powershell</string>
6585-
</dict>
6586-
<dict>
6587-
<key>comment</key>
6588-
<string>`,` just continues current mode</string>
6584+
<string>`||` and `&amp;&amp;` conditional terminators are reserved.</string>
65896585
<key>match</key>
6590-
<string>,</string>
6586+
<string>\|\||&amp;&amp;</string>
65916587
<key>name</key>
6592-
<string>punctuation.separator.powershell</string>
6588+
<string>invalid.reserved.powershell</string>
65936589
</dict>
65946590
</array>
65956591
</dict>
@@ -6974,11 +6970,15 @@
69746970
<dict>
69756971
<key>patterns</key>
69766972
<array>
6973+
<dict>
6974+
<key>include</key>
6975+
<string>#terminators</string>
6976+
</dict>
69776977
<dict>
69786978
<key>comment</key>
69796979
<string>`&amp;` resume's in statement mode</string>
69806980
<key>begin</key>
6981-
<string>&amp;(?!&amp;)</string>
6981+
<string>&amp;</string>
69826982
<key>beginCaptures</key>
69836983
<dict>
69846984
<key>0</key>

0 commit comments

Comments
 (0)