|
56 | 56 | </dict> |
57 | 57 | </array> |
58 | 58 | </dict> |
| 59 | + <dict> |
| 60 | + <key>match</key> |
| 61 | + <string>[2-6]>&1|>>|>|<<|<|>|>\||[1-6]>|[1-6]>></string> |
| 62 | + <key>name</key> |
| 63 | + <string>keyword.operator.redirection.powershell</string> |
| 64 | + </dict> |
59 | 65 | <dict> |
60 | 66 | <key>include</key> |
61 | 67 | <string>#commands</string> |
|
226 | 232 | </dict> |
227 | 233 | <dict> |
228 | 234 | <key>match</key> |
229 | | - <string>-([ci]?[lg][te]|eq|ne)</string> |
| 235 | + <string>(?<!\w)-([ci]?[lg][te]|eq|ne)</string> |
230 | 236 | <key>name</key> |
231 | 237 | <string>keyword.operator.logical.powershell</string> |
232 | 238 | </dict> |
233 | 239 | <dict> |
234 | 240 | <key>match</key> |
235 | | - <string>(?i:[a-z][a-z0-9]+-?[a-z][a-z0-9]+)(?i:\.(?:exe|cmd|bat|ps1))</string> |
| 241 | + <string>(?i:([\S&&[^<>"/\|?*]])+)(?i:\.(?i:exe|cmd|bat|ps1))</string> |
236 | 242 | <key>name</key> |
237 | 243 | <string>support.function.powershell</string> |
238 | 244 | </dict> |
239 | 245 | <dict> |
240 | 246 | <key>match</key> |
241 | | - <string>(?<!\w)((?i:begin|break|catch|class|continue|data|define|do|dynamicparam|else|elseif|end|exit|filter|finally|for|foreach(?!=-object)|from|if|in|inlinescript|parallel|param|process|return|switch|throw|trap|try|until|using|var|where(?!=-object)|while|workflow)|%|\?)(?!\w)</string> |
| 247 | + <string>(?<!\w)((?i:begin|break|catch|class|continue|data|define|do|dynamicparam|else|elseif|end|exit|filter|finally|for|foreach(?!-object)|from|if|in|inlinescript|parallel|param|process|return|switch|throw|trap|try|until|using|var|where(?!=-object)|while|workflow)|%|\?)(?!\w)</string> |
242 | 248 | <key>name</key> |
243 | 249 | <string>keyword.control.powershell</string> |
244 | 250 | </dict> |
245 | 251 | <dict> |
246 | 252 | <key>match</key> |
247 | | - <string>-(?i:is(?:not)?|as)\b</string> |
| 253 | + <string>(?<!\w)-(?i:is(?:not)?|as)\b</string> |
248 | 254 | <key>name</key> |
249 | 255 | <string>keyword.operator.comparison.powershell</string> |
250 | 256 | </dict> |
251 | 257 | <dict> |
252 | 258 | <key>match</key> |
253 | | - <string>-(?i:[ic]?(?:eq|ne|[gl][te]|(?:not)?(?:like|match|contains|in)|replace))(?!\p{L})</string> |
| 259 | + <string>(?<!\w)-(?i:[ic]?(?:eq|ne|[gl][te]|(?:not)?(?:like|match|contains|in)|replace))(?!\p{L})</string> |
254 | 260 | <key>name</key> |
255 | 261 | <string>keyword.operator.comparison.powershell</string> |
256 | 262 | </dict> |
257 | 263 | <dict> |
258 | 264 | <key>match</key> |
259 | | - <string>-(?i:join|split)(?!\p{L})|!</string> |
| 265 | + <string>(?<!\w)-(?i:join|split)(?!\p{L})|!</string> |
260 | 266 | <key>name</key> |
261 | 267 | <string>keyword.operator.unary.powershell</string> |
262 | 268 | </dict> |
263 | 269 | <dict> |
264 | 270 | <key>match</key> |
265 | | - <string>-(?i:and|or|not|xor)(?!\p{L})|!</string> |
| 271 | + <string>(?<!\w)-(?i:and|or|not|xor)(?!\p{L})|!</string> |
266 | 272 | <key>name</key> |
267 | 273 | <string>keyword.operator.logical.powershell</string> |
268 | 274 | </dict> |
269 | 275 | <dict> |
270 | 276 | <key>match</key> |
271 | | - <string>-(?i:band|bor|bnot|bxor)(?!\p{L})</string> |
| 277 | + <string>(?<!\w)-(?i:band|bor|bnot|bxor)(?!\p{L})</string> |
272 | 278 | <key>name</key> |
273 | 279 | <string>keyword.operator.bitwise.powershell</string> |
274 | 280 | </dict> |
275 | 281 | <dict> |
276 | 282 | <key>match</key> |
277 | | - <string>-(?i:f)(?!\p{L})</string> |
| 283 | + <string>(?<!\w)-(?i:f)(?!\p{L})</string> |
278 | 284 | <key>name</key> |
279 | 285 | <string>keyword.operator.string-format.powershell</string> |
280 | 286 | </dict> |
|
284 | 290 | <key>name</key> |
285 | 291 | <string>keyword.operator.assignment.powershell</string> |
286 | 292 | </dict> |
287 | | - <dict> |
288 | | - <key>match</key> |
289 | | - <string>[2-6]>&1|>>|>|<<|<|>|>\||[1-6]>|[1-6]>></string> |
290 | | - <key>name</key> |
291 | | - <string>keyword.operator.redirection.powershell</string> |
292 | | - </dict> |
293 | 293 | <dict> |
294 | 294 | <key>match</key> |
295 | 295 | <string>\|{2}|&{2}|;</string> |
|
387 | 387 | </dict> |
388 | 388 | <key>commands</key> |
389 | 389 | <dict> |
390 | | - <key>comment</key> |
391 | | - <string>Verb-Noun pattern:</string> |
392 | | - <key>match</key> |
393 | | - <string>(?:(\p{L}|\d|_|-|\\|\:)*\\)?\b(?i:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Mount|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Write)\-.+?(?:\.(?:exe|cmd|bat|ps1))?\b</string> |
394 | | - <key>name</key> |
395 | | - <string>support.function.powershell</string> |
| 390 | + <key>patterns</key> |
| 391 | + <array> |
| 392 | + <dict> |
| 393 | + <key>comment</key> |
| 394 | + <string>Verb-Noun pattern:</string> |
| 395 | + <key>match</key> |
| 396 | + <string>(?:(\p{L}|\d|_|-|\\|\:)*\\)?\b(?i:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Mount|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Write)\-.+?(?:\.(?i:exe|cmd|bat|ps1))?\b</string> |
| 397 | + <key>name</key> |
| 398 | + <string>support.function.powershell</string> |
| 399 | + </dict> |
| 400 | + <dict> |
| 401 | + <key>comment</key> |
| 402 | + <string>Builtin cmdlets with reserved verbs</string> |
| 403 | + <key>match</key> |
| 404 | + <string>(?<!\w)(?i:foreach-object)(?!\w)</string> |
| 405 | + <key>name</key> |
| 406 | + <string>support.function.powershell</string> |
| 407 | + </dict> |
| 408 | + </array> |
396 | 409 | </dict> |
397 | 410 | <key>commentEmbeddedDocs</key> |
398 | 411 | <dict> |
|
488 | 501 | <key>function</key> |
489 | 502 | <dict> |
490 | 503 | <key>begin</key> |
491 | | - <string>(function|configuration)\s+((?:\p{L}|\d|_|-)+)</string> |
| 504 | + <string>(?i:function|configuration)\s+((?:\p{L}|\d|_|-)+)</string> |
492 | 505 | <key>beginCaptures</key> |
493 | 506 | <dict> |
494 | 507 | <key>0</key> |
|
0 commit comments