Skip to content

Commit 06ce630

Browse files
committed
fix splat regression
1 parent ab8e463 commit 06ce630

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

PowerShellSyntax.tmLanguage

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,7 +2714,7 @@
27142714
<key>comment</key>
27152715
<string>patterns that indicate an expression, might be able to simplify this to include expression_mode and then see if the cursor advanced, sorta, don't forget about 'notCode', maybe check operand/operator only first, as redirect could also be a problem.</string>
27162716
<key>begin</key>
2717-
<string>(?=\$[{(\w:$?^]|@?[({]|(?&gt;@(?:(?&gt;[\w][\w?]*:(?!:)|:)?(?:[\w?](?:[\w?]|:(?!:))*|:(?!:))|[$^:]))[^~`!@#$%^*&lt;&gt;\]\\/"\x{201C}-\x{201E}'\x{2018}-\x{201B}+\x{2013}-\x{2015}-]|[,\["\x{201C}-\x{201E}'\x{2018}-\x{201B}])|(?=@?(['\x{2018}-\x{201B}"\x{201C}-\x{201E}])(?:(?&lt;!@\g&lt;1&gt;)|\s*$))|(?=[\x{2013}-\x{2015}-][\s#{(,;|)}&lt;&gt;.!+%*/="\x{201C}-\x{201E}'\x{2018}-\x{201B}\x{2013}-\x{2015}-])</string>
2717+
<string>(?=[$@][{(\w:$?^]|[({]|[,\["\x{201C}-\x{201E}'\x{2018}-\x{201B}])|(?=@?(['\x{2018}-\x{201B}"\x{201C}-\x{201E}])(?:(?&lt;!@\g&lt;1&gt;)|\s*$))|(?=[\x{2013}-\x{2015}-][\s#{(,;|)}&lt;&gt;.!+%*/="\x{201C}-\x{201E}'\x{2018}-\x{201B}\x{2013}-\x{2015}-])</string>
27182718
<key>end</key>
27192719
<string>$(?=\n)|(?=[;)}\]])</string>
27202720
<key>patterns</key>
@@ -2946,6 +2946,25 @@
29462946
<key>include</key>
29472947
<string>#substatement</string>
29482948
</dict>
2949+
<dict>
2950+
<key>comment</key>
2951+
<string>splatting cannot have members and certain characters following, including no line comment</string>
2952+
<key>match</key>
2953+
<string>(?&gt;@(?:(?&gt;[\w][\w?]*:(?!:)|:)?(?:[\w?](?:[\w?]|:(?!:))*|:(?!:))|[$^:]))(?![~`!@#$%^*&lt;&gt;\]\\/"\x{201C}-\x{201E}'\x{2018}-\x{201B}+-])</string>
2954+
<key>captures</key>
2955+
<dict>
2956+
<key>0</key>
2957+
<dict>
2958+
<key>patterns</key>
2959+
<array>
2960+
<dict>
2961+
<key>include</key>
2962+
<string>#variable_inner</string>
2963+
</dict>
2964+
</array>
2965+
</dict>
2966+
</dict>
2967+
</dict>
29492968
<dict>
29502969
<key>include</key>
29512970
<string>#unquotedArgument</string>
@@ -5874,20 +5893,9 @@
58745893
<key>comment</key>
58755894
<string>splatting cannot have members and certain characters following, including no line comment</string>
58765895
<key>match</key>
5877-
<string>\G(?&gt;@(?:(?&gt;[\w][\w?]*:(?!:)|:)?(?:[\w?](?:[\w?]|:(?!:))*|:(?!:))|[$^:]))(?![~`!@#$%^*&lt;&gt;\]\\/"\x{201C}-\x{201E}'\x{2018}-\x{201B}+-])</string>
5878-
<key>captures</key>
5879-
<dict>
5880-
<key>0</key>
5881-
<dict>
5882-
<key>patterns</key>
5883-
<array>
5884-
<dict>
5885-
<key>include</key>
5886-
<string>#variable_inner</string>
5887-
</dict>
5888-
</array>
5889-
</dict>
5890-
</dict>
5896+
<string>(?&gt;@(?:(?&gt;[\w][\w?]*:(?!:)|:)?(?:[\w?](?:[\w?]|:(?!:))*|:(?!:))|[$^:]))</string>
5897+
<key>name</key>
5898+
<string>invalid.splat.powershell</string>
58915899
</dict>
58925900
</array>
58935901
</dict>

0 commit comments

Comments
 (0)