|
561 | 561 | <key>begin</key> |
562 | 562 | <string>(?!\G)(?!$(?=\n)|[;&|)}\]])</string> |
563 | 563 | <key>end</key> |
564 | | - <string>$(?=\n)|(?=[;&|)}\]])</string> |
| 564 | + <string>$(?=\n)|(?=[;)}\]])</string> |
565 | 565 | <key>patterns</key> |
566 | 566 | <array> |
567 | 567 | <dict> |
|
584 | 584 | <key>begin</key> |
585 | 585 | <string>(?!$(?=\n)|[;&|)}\]])</string> |
586 | 586 | <key>end</key> |
587 | | - <string>$(?=\n)|(?=[;&|)}\]])</string> |
| 587 | + <string>$(?=\n)|(?=[;)}\]])</string> |
588 | 588 | <key>patterns</key> |
589 | 589 | <array> |
590 | 590 | <dict> |
|
654 | 654 | <array> |
655 | 655 | <dict> |
656 | 656 | <key>begin</key> |
657 | | - <string>(?:(global|local|script|private)(`)?(:)(?=[^\s{(,;&)}])|(?=[^`"\x{201C}-\x{201E}'\x{2018}-\x{201B}\s{(,;&)}<>@#\]]|`(?!\s)))</string> |
| 657 | + <string>(?:(global|local|script|private)(`)?(:)(?=[^\s{(,;&)}])|(?=[^`'"\x{2018}-\x{201E}\s{(,;&)}<>@#\]]|`(?!\s)))</string> |
658 | 658 | <key>beginCaptures</key> |
659 | 659 | <dict> |
660 | 660 | <key>1</key> |
|
2568 | 2568 | <key>comment</key> |
2569 | 2569 | <string>(dot) source operator, requires trailing space, or invoke operator</string> |
2570 | 2570 | <key>begin</key> |
2571 | | - <string>&|\.(?=[\s{(,;&|)}"\x{201C}-\x{201E}'\x{2018}-\x{201B}]|\$[\p{L}$?^:_{(])</string> |
| 2571 | + <string>&|\.(?=[\s{(,;&|)}'"\x{2018}-\x{201E}$@])</string> |
2572 | 2572 | <key>beginCaptures</key> |
2573 | 2573 | <dict> |
2574 | 2574 | <key>0</key> |
|
2761 | 2761 | <key>comment</key> |
2762 | 2762 | <string>command names are allowed to start with < or >, without a backtick, but `function` requires a backtick. See below!</string> |
2763 | 2763 | <key>begin</key> |
2764 | | - <string>(?:(global|local|script|private)(`)?(:)(?=[^\s{(,;&|)}])|(?=[^`"\x{201C}-\x{201E}'\x{2018}-\x{201B}\s{(,;&)}@#\]]|`(?!\s)))</string> |
| 2764 | + <string>(?:(global|local|script|private)(`)?(:)(?=[^\s{(,;&|)}])|(?=[^`'"\x{2018}-\x{201E}\s{(,;&)}@#\]]|`(?!\s)))</string> |
2765 | 2765 | <key>beginCaptures</key> |
2766 | 2766 | <dict> |
2767 | 2767 | <key>1</key> |
|
2934 | 2934 | <key>comment</key> |
2935 | 2935 | <string>splatting cannot have members and certain characters following, including no line comment</string> |
2936 | 2936 | <key>match</key> |
2937 | | - <string>(?>@(?:(?>[\w][\w?]*:(?!:)|:)?(?:[\w?](?:[\w?]|:(?!:))*|:(?!:))|[$^:]))(?![~`!@#$%^*<>\]\\/"\x{201C}-\x{201E}'\x{2018}-\x{201B}+-])</string> |
| 2937 | + <string>(?>@(?:(?>[\w][\w?]*:(?!:)|:)?(?:[\w?](?:[\w?]|:(?!:))*|:(?!:))|[$^:]))(?![~`!@#$%^*<>\]\\/'"\x{2018}-\x{201E}+-])</string> |
2938 | 2938 | <key>captures</key> |
2939 | 2939 | <dict> |
2940 | 2940 | <key>0</key> |
|
3562 | 3562 | <array> |
3563 | 3563 | <dict> |
3564 | 3564 | <key>match</key> |
3565 | | - <string>`[`0abefnrtv"\x{201C}-\x{201E}'\x{2018}-\x{201B}$@#{(,;&|)}<>\n]</string> |
| 3565 | + <string>`[`0abefnrtv'"\x{2018}-\x{201E}$@#{(,;&|)}<>\n]</string> |
3566 | 3566 | <key>name</key> |
3567 | 3567 | <string>constant.character.escape.powershell</string> |
3568 | 3568 | </dict> |
|
3578 | 3578 | </dict> |
3579 | 3579 | </array> |
3580 | 3580 | </dict> |
3581 | | - <key>attribute</key> |
3582 | | - <dict> |
3583 | | - <key>patterns</key> |
3584 | | - <array> |
3585 | | - <dict> |
3586 | | - <key>begin</key> |
3587 | | - <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))(?=\())</string> |
3588 | | - <key>beginCaptures</key> |
3589 | | - <dict> |
3590 | | - <key>0</key> |
3591 | | - <dict> |
3592 | | - <key>name</key> |
3593 | | - <string>support.function.attribute.powershell</string> |
3594 | | - </dict> |
3595 | | - </dict> |
3596 | | - <key>end</key> |
3597 | | - <string>(?!\G\()</string> |
3598 | | - <key>name</key> |
3599 | | - <string>meta.attribute.powershell</string> |
3600 | | - <key>patterns</key> |
3601 | | - <array> |
3602 | | - <dict> |
3603 | | - <key>begin</key> |
3604 | | - <string>\(</string> |
3605 | | - <key>beginCaptures</key> |
3606 | | - <dict> |
3607 | | - <key>0</key> |
3608 | | - <dict> |
3609 | | - <key>name</key> |
3610 | | - <string>punctuation.section.group.begin.powershell</string> |
3611 | | - </dict> |
3612 | | - </dict> |
3613 | | - <key>end</key> |
3614 | | - <string>\)</string> |
3615 | | - <key>endCaptures</key> |
3616 | | - <dict> |
3617 | | - <key>0</key> |
3618 | | - <dict> |
3619 | | - <key>name</key> |
3620 | | - <string>punctuation.section.group.end.powershell</string> |
3621 | | - </dict> |
3622 | | - </dict> |
3623 | | - <key>patterns</key> |
3624 | | - <array> |
3625 | | - <dict> |
3626 | | - <key>comment</key> |
3627 | | - <string>`key` for DscProperty attribute</string> |
3628 | | - <key>begin</key> |
3629 | | - <string>(?i)\b(mandatory|valuefrom(?:pipeline(?:bypropertyname)?|remainingarguments)|position(?:albinding)?|(?:default)?parametersetname|supports(?:shouldprocess|paging|transactions)|help(?:uri|message)|confirmimpact|ignorecase|key)\b</string> |
3630 | | - <key>beginCaptures</key> |
3631 | | - <dict> |
3632 | | - <key>1</key> |
3633 | | - <dict> |
3634 | | - <key>name</key> |
3635 | | - <string>variable.parameter.attribute.powershell</string> |
3636 | | - </dict> |
3637 | | - </dict> |
3638 | | - <key>end</key> |
3639 | | - <string>$(?=\n)|(?=[,;&|)}\]])</string> |
3640 | | - <key>patterns</key> |
3641 | | - <array> |
3642 | | - <dict> |
3643 | | - <key>begin</key> |
3644 | | - <string>=</string> |
3645 | | - <key>beginCaptures</key> |
3646 | | - <dict> |
3647 | | - <key>0</key> |
3648 | | - <dict> |
3649 | | - <key>name</key> |
3650 | | - <string>keyword.operator.assignment.powershell</string> |
3651 | | - </dict> |
3652 | | - </dict> |
3653 | | - <key>end</key> |
3654 | | - <string>$(?=\n)|(?=[,;&|)}\]])</string> |
3655 | | - <key>patterns</key> |
3656 | | - <array> |
3657 | | - <dict> |
3658 | | - <key>include</key> |
3659 | | - <string>#advanceToToken</string> |
3660 | | - </dict> |
3661 | | - <dict> |
3662 | | - <key>comment</key> |
3663 | | - <string>begin at the first token in the expression, to test for numeric and unary operators</string> |
3664 | | - <key>begin</key> |
3665 | | - <string>(?!$|[;|)}\]])</string> |
3666 | | - <key>end</key> |
3667 | | - <string>(?=.|$)</string> |
3668 | | - <key>applyEndPatternLast</key> |
3669 | | - <true/> |
3670 | | - <key>patterns</key> |
3671 | | - <array> |
3672 | | - <dict> |
3673 | | - <key>comment</key> |
3674 | | - <string>allow for possibility that numeric value or unary operators match first, before resuming in expression mode</string> |
3675 | | - <key>begin</key> |
3676 | | - <string>(?!\G)(?!$(?=\n)|[,;&|)}\]])</string> |
3677 | | - <key>end</key> |
3678 | | - <string>$(?=\n)|(?=[,;&|)}\]])</string> |
3679 | | - <key>patterns</key> |
3680 | | - <array> |
3681 | | - <dict> |
3682 | | - <key>include</key> |
3683 | | - <string>#expression_mode</string> |
3684 | | - </dict> |
3685 | | - </array> |
3686 | | - </dict> |
3687 | | - <dict> |
3688 | | - <key>include</key> |
3689 | | - <string>#numericConstant</string> |
3690 | | - </dict> |
3691 | | - <dict> |
3692 | | - <key>include</key> |
3693 | | - <string>#operators_preUnary</string> |
3694 | | - </dict> |
3695 | | - <dict> |
3696 | | - <key>comment</key> |
3697 | | - <string>if neither numeric or a pre-unary operator, just finish in expression mode</string> |
3698 | | - <key>begin</key> |
3699 | | - <string>(?!$(?=\n)|[;&|)}\]])</string> |
3700 | | - <key>end</key> |
3701 | | - <string>$(?=\n)|(?=[;&|)}\]])</string> |
3702 | | - <key>patterns</key> |
3703 | | - <array> |
3704 | | - <dict> |
3705 | | - <key>include</key> |
3706 | | - <string>#expression_mode</string> |
3707 | | - </dict> |
3708 | | - </array> |
3709 | | - </dict> |
3710 | | - </array> |
3711 | | - </dict> |
3712 | | - </array> |
3713 | | - </dict> |
3714 | | - </array> |
3715 | | - </dict> |
3716 | | - <dict> |
3717 | | - <key>include</key> |
3718 | | - <string>#expression_mode</string> |
3719 | | - </dict> |
3720 | | - </array> |
3721 | | - </dict> |
3722 | | - </array> |
3723 | | - </dict> |
3724 | | - <dict> |
3725 | | - <key>match</key> |
3726 | | - <string>(?<![.\w-])(?i:ordered)(?![.\w+`\[-])</string> |
3727 | | - <key>name</key> |
3728 | | - <string>support.function.attribute.powershell</string> |
3729 | | - </dict> |
3730 | | - <dict> |
3731 | | - <key>match</key> |
3732 | | - <string>(?<![.\w-])(?i:ref)(?![.\w+`\[-])</string> |
3733 | | - <key>name</key> |
3734 | | - <string>storage.modifier.powershell</string> |
3735 | | - </dict> |
3736 | | - </array> |
3737 | | - </dict> |
3738 | 3581 | <key>commands</key> |
3739 | 3582 | <dict> |
3740 | 3583 | <key>patterns</key> |
|
4838 | 4681 | <string>#advanceToToken</string> |
4839 | 4682 | </dict> |
4840 | 4683 | <dict> |
4841 | | - <key>ignore include</key> |
4842 | | - <string>#attribute</string> |
4843 | 4684 | <key>match</key> |
4844 | 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> |
4845 | 4686 | <key>name</key> |
|
4919 | 4760 | <key>comment</key> |
4920 | 4761 | <string>begin at the first token in the expression, to test for numeric and unary operators</string> |
4921 | 4762 | <key>begin</key> |
4922 | | - <string>(?!$|[;|)}\]])</string> |
| 4763 | + <string>(?!$|[,;|)}\]])</string> |
4923 | 4764 | <key>end</key> |
4924 | 4765 | <string>(?=.|$)</string> |
4925 | 4766 | <key>applyEndPatternLast</key> |
|
4953 | 4794 | <key>comment</key> |
4954 | 4795 | <string>if neither numeric or a pre-unary operator, just finish in expression mode</string> |
4955 | 4796 | <key>begin</key> |
4956 | | - <string>(?!$(?=\n)|[;&|)}\]])</string> |
| 4797 | + <string>(?!$(?=\n)|[,;&|)}\]])</string> |
4957 | 4798 | <key>end</key> |
4958 | | - <string>$(?=\n)|(?=[;&|)}\]])</string> |
| 4799 | + <string>$(?=\n)|(?=[,;&|)}\]])</string> |
4959 | 4800 | <key>patterns</key> |
4960 | 4801 | <array> |
4961 | 4802 | <dict> |
|
4966 | 4807 | </dict> |
4967 | 4808 | </array> |
4968 | 4809 | </dict> |
| 4810 | + <dict> |
| 4811 | + <key>include</key> |
| 4812 | + <string>#notCode</string> |
| 4813 | + </dict> |
4969 | 4814 | </array> |
4970 | 4815 | </dict> |
4971 | 4816 | <dict> |
|
4975 | 4820 | </array> |
4976 | 4821 | </dict> |
4977 | 4822 | <dict> |
| 4823 | + <key>comment</key> |
| 4824 | + <string>this makes `=` invalid without an argument name</string> |
4978 | 4825 | <key>match</key> |
4979 | 4826 | <string>=</string> |
4980 | 4827 | <key>name</key> |
4981 | 4828 | <string>invalid.source.powershell</string> |
4982 | 4829 | </dict> |
4983 | 4830 | <dict> |
| 4831 | + <key>comment</key> |
| 4832 | + <string>this gets the comma as well as quoted or numeric literals</string> |
4984 | 4833 | <key>include</key> |
4985 | 4834 | <string>#expression_mode</string> |
4986 | 4835 | </dict> |
|
5220 | 5069 | <key>name</key> |
5221 | 5070 | <string>support.class.powershell</string> |
5222 | 5071 | </dict> |
| 5072 | + <dict> |
| 5073 | + <key>match</key> |
| 5074 | + <string>(?<![.\w-])(?i:ordered)(?![.\w+`\[-])</string> |
| 5075 | + <key>name</key> |
| 5076 | + <string>support.function.attribute.powershell</string> |
| 5077 | + </dict> |
| 5078 | + <dict> |
| 5079 | + <key>match</key> |
| 5080 | + <string>(?<![.\w-])(?i:ref)(?![.\w+`\[-])</string> |
| 5081 | + <key>name</key> |
| 5082 | + <string>storage.modifier.powershell</string> |
| 5083 | + </dict> |
5223 | 5084 | </array> |
5224 | 5085 | </dict> |
5225 | 5086 | <key>advanceToArgument</key> |
|
0 commit comments