|
5764 | 5764 | </dict> |
5765 | 5765 | <key>RequiresDirective</key> |
5766 | 5766 | <dict> |
5767 | | - <key>begin</key> |
| 5767 | + <key>comment</key> |
| 5768 | + <string>requires directive must be on single line, so capture and tokenize, current PS <= 6.2 allow `requires` keyword without delimiter, but the parameters must follow with a delimiter!</string> |
| 5769 | + <key>oldbegin</key> |
5768 | 5770 | <string>^\s*(#)((?i:requires))(?![^\s{(,;&|)}])</string> |
5769 | | - <key>beginCaptures</key> |
| 5771 | + <key>match</key> |
| 5772 | + <string>^\s*(#)((?i:requires))(.?)(.*)$</string> |
| 5773 | + <key>captures</key> |
5770 | 5774 | <dict> |
5771 | 5775 | <key>1</key> |
5772 | 5776 | <dict> |
|
5778 | 5782 | <key>name</key> |
5779 | 5783 | <string>keyword.control.requires.powershell</string> |
5780 | 5784 | </dict> |
5781 | | - </dict> |
5782 | | - <key>end</key> |
5783 | | - <string>$</string> |
5784 | | - <key>name</key> |
5785 | | - <string>comment.line.powershell meta.requires.powershell</string> |
5786 | | - <key>patterns</key> |
5787 | | - <array> |
| 5785 | + <key>3</key> |
5788 | 5786 | <dict> |
5789 | | - <key>match</key> |
5790 | | - <string>([\x{2013}-\x{2015}-](?i:Modules|PSSnapin|PSEdition|RunAsAdministrator|ShellId|Version)\b)(:)?</string> |
5791 | | - <key>captures</key> |
5792 | | - <dict> |
5793 | | - <key>1</key> |
| 5787 | + <key>patterns</key> |
| 5788 | + <array> |
5794 | 5789 | <dict> |
| 5790 | + <key>match</key> |
| 5791 | + <string>\S</string> |
5795 | 5792 | <key>name</key> |
5796 | | - <string>entity.name.parameter.powershell</string> |
| 5793 | + <string>invalid.source.powershell</string> |
| 5794 | + </dict> |
| 5795 | + </array> |
| 5796 | + </dict> |
| 5797 | + <key>4</key> |
| 5798 | + <dict> |
| 5799 | + <key>patterns</key> |
| 5800 | + <array> |
| 5801 | + <dict> |
| 5802 | + <key>match</key> |
| 5803 | + <string>([\x{2013}-\x{2015}-](?i:Modules|PSSnapin|PSEdition|RunAsAdministrator|ShellId|Version)\b)(:)?</string> |
| 5804 | + <key>captures</key> |
| 5805 | + <dict> |
| 5806 | + <key>1</key> |
| 5807 | + <dict> |
| 5808 | + <key>name</key> |
| 5809 | + <string>entity.name.parameter.powershell</string> |
| 5810 | + </dict> |
| 5811 | + <key>2</key> |
| 5812 | + <dict> |
| 5813 | + <key>name</key> |
| 5814 | + <string>punctuation.separator.parameter-value.powershell</string> |
| 5815 | + </dict> |
| 5816 | + </dict> |
5797 | 5817 | </dict> |
5798 | | - <key>2</key> |
5799 | 5818 | <dict> |
| 5819 | + <key>comment</key> |
| 5820 | + <string>needs custom argument handler, single line quoted or unquoted arguments</string> |
| 5821 | + <key>match</key> |
| 5822 | + <string>(?<!\x{2013}-\x{2015}-)\b\p{L}+|\d+(?:\.\d+)*</string> |
5800 | 5823 | <key>name</key> |
5801 | | - <string>punctuation.separator.parameter-value.powershell</string> |
| 5824 | + <string>variable.parameter.powershell</string> |
5802 | 5825 | </dict> |
5803 | | - </dict> |
5804 | | - </dict> |
5805 | | - <dict> |
5806 | | - <key>comment</key> |
5807 | | - <string>needs custom argument handler, single line quoted or unquoted arguments</string> |
5808 | | - <key>match</key> |
5809 | | - <string>(?<!\x{2013}-\x{2015}-)\b\p{L}+|\d+(?:\.\d+)*</string> |
5810 | | - <key>name</key> |
5811 | | - <string>variable.parameter.powershell</string> |
5812 | | - </dict> |
5813 | | - <dict> |
5814 | | - <key>match</key> |
5815 | | - <string>,</string> |
5816 | | - <key>name</key> |
5817 | | - <string>punctuation.separator.powershell</string> |
5818 | | - </dict> |
5819 | | - <dict> |
5820 | | - <key>comment</key> |
5821 | | - <string>needs custom hashtable that does not auto continue to next line</string> |
5822 | | - <key>include</key> |
5823 | | - <string>#hashtable</string> |
5824 | | - </dict> |
5825 | | - <dict> |
5826 | | - <key>include</key> |
5827 | | - <string>#notCode</string> |
| 5826 | + <dict> |
| 5827 | + <key>match</key> |
| 5828 | + <string>,</string> |
| 5829 | + <key>name</key> |
| 5830 | + <string>punctuation.separator.powershell</string> |
| 5831 | + </dict> |
| 5832 | + <dict> |
| 5833 | + <key>comment</key> |
| 5834 | + <string>needs custom hashtable that does not auto continue to next line</string> |
| 5835 | + <key>include</key> |
| 5836 | + <string>#hashtable</string> |
| 5837 | + </dict> |
| 5838 | + <dict> |
| 5839 | + <key>include</key> |
| 5840 | + <string>#notCode</string> |
| 5841 | + </dict> |
| 5842 | + </array> |
5828 | 5843 | </dict> |
5829 | | - </array> |
| 5844 | + </dict> |
| 5845 | + <key>oldend</key> |
| 5846 | + <string>$</string> |
| 5847 | + <key>name</key> |
| 5848 | + <string>comment.line.powershell meta.requires.powershell</string> |
5830 | 5849 | </dict> |
5831 | 5850 | <key>hashtable</key> |
5832 | 5851 | <dict> |
|
0 commit comments