2 /************************************************************************************* |
2 /************************************************************************************* |
3 * powershell.php |
3 * powershell.php |
4 * --------------------------------- |
4 * --------------------------------- |
5 * Author: Frode Aarebrot (frode@aarebrot.net) |
5 * Author: Frode Aarebrot (frode@aarebrot.net) |
6 * Copyright: (c) 2008 Frode Aarebrot (http://www.aarebrot.net) |
6 * Copyright: (c) 2008 Frode Aarebrot (http://www.aarebrot.net) |
7 * Release Version: 1.0.8.2 |
7 * Release Version: 1.0.8.4 |
8 * Date Started: 2008/06/20 |
8 * Date Started: 2008/06/20 |
9 * |
9 * |
10 * PowerShell language file for GeSHi. |
10 * PowerShell language file for GeSHi. |
11 * |
11 * |
12 * I've tried to make this language file as true to the highlighting in PowerGUI as |
12 * I've tried to make this language file as true to the highlighting in PowerGUI as |
45 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
45 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
46 * |
46 * |
47 ************************************************************************************/ |
47 ************************************************************************************/ |
48 |
48 |
49 $language_data = array ( |
49 $language_data = array ( |
50 'LANG_NAME' => 'posh', |
50 'LANG_NAME' => 'PowerShell', |
51 'COMMENT_SINGLE' => array(1 => '#'), |
51 'COMMENT_SINGLE' => array(1 => '#'), |
52 'COMMENT_MULTI' => array(), |
52 'COMMENT_MULTI' => array(), |
53 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, |
53 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, |
54 'QUOTEMARKS' => array("'", '"'), |
54 'QUOTEMARKS' => array("'", '"'), |
55 'ESCAPE_CHAR' => '`', |
55 'ESCAPE_CHAR' => '`', |
137 '-Column', '-Class', '-ChildPath', '-Character', '-Certificate', '-CategoryTargetType', |
137 '-Column', '-Class', '-ChildPath', '-Character', '-Certificate', '-CategoryTargetType', |
138 '-CategoryTargetName', '-CategoryReason', '-CategoryActivity', '-Category', '-CaseSensitive', |
138 '-CategoryTargetName', '-CategoryReason', '-CategoryActivity', '-Category', '-CaseSensitive', |
139 '-Body', '-BinaryPathName', '-Begin', '-BackgroundColor', '-Average', '-AutoSize', '-Audit', |
139 '-Body', '-BinaryPathName', '-Begin', '-BackgroundColor', '-Average', '-AutoSize', '-Audit', |
140 '-AsString', '-AsSecureString', '-AsPlainText', '-As', '-ArgumentList', '-AppendPath', '-Append', |
140 '-AsString', '-AsSecureString', '-AsPlainText', '-As', '-ArgumentList', '-AppendPath', '-Append', |
141 '-Adjust', '-Activity', '-AclObject' |
141 '-Adjust', '-Activity', '-AclObject' |
|
142 ), |
|
143 6 => array( |
|
144 '_','args','DebugPreference','Error','ErrorActionPreference', |
|
145 'foreach','Home','Host','Input','LASTEXITCODE','MaximumAliasCount', |
|
146 'MaximumDriveCount','MaximumFunctionCount','MaximumHistoryCount', |
|
147 'MaximumVariableCount','OFS','PsHome', |
|
148 'ReportErrorShowExceptionClass','ReportErrorShowInnerException', |
|
149 'ReportErrorShowSource','ReportErrorShowStackTrace', |
|
150 'ShouldProcessPreference','ShouldProcessReturnPreference', |
|
151 'StackTrace','VerbosePreference','WarningPreference','PWD' |
142 ) |
152 ) |
143 ), |
153 ), |
144 'SYMBOLS' => array( |
154 'SYMBOLS' => array( |
145 '(', ')', '[', ']', '{', '}', '=', '<', '>', '@', '|', '&', ',', '?', |
155 '(', ')', '[', ']', '{', '}', '=', '<', '>', '@', '|', '&', ',', '?', |
146 '+=', '-=', '*=', '/=', '%=', '*', '/', '%', '!', '+', '-', '++', '--' |
156 '+=', '-=', '*=', '/=', '%=', '*', '/', '%', '!', '+', '-', '++', '--' |
149 GESHI_COMMENTS => false, |
159 GESHI_COMMENTS => false, |
150 1 => false, |
160 1 => false, |
151 2 => false, |
161 2 => false, |
152 3 => false, |
162 3 => false, |
153 4 => false, |
163 4 => false, |
154 5 => false |
164 5 => false, |
|
165 6 => true |
155 ), |
166 ), |
156 'STYLES' => array( |
167 'STYLES' => array( |
157 'KEYWORDS' => array( |
168 'KEYWORDS' => array( |
158 1 => 'color: #008080; font-weight: bold;', |
169 1 => 'color: #008080; font-weight: bold;', |
159 2 => 'color: #008080; font-weight: bold;', |
170 2 => 'color: #008080; font-weight: bold;', |
160 3 => 'color: #0000FF;', |
171 3 => 'color: #0000FF;', |
161 4 => 'color: #FF0000;', |
172 4 => 'color: #FF0000;', |
162 5 => 'color: #008080; font-style: italic;', |
173 5 => 'color: #008080; font-style: italic;', |
|
174 6 => 'color: #000080;' |
163 ), |
175 ), |
164 'COMMENTS' => array( |
176 'COMMENTS' => array( |
165 1 => 'color: #008000;', |
177 1 => 'color: #008000;', |
166 'MULTI' => 'color: #008000;' |
178 'MULTI' => 'color: #008000;' |
167 ), |
179 ), |
231 GESHI_BEFORE => '\1', |
242 GESHI_BEFORE => '\1', |
232 GESHI_AFTER => '' |
243 GESHI_AFTER => '' |
233 ), |
244 ), |
234 // Special variables |
245 // Special variables |
235 6 => array( |
246 6 => array( |
236 GESHI_SEARCH => '(\$)(\$|\?|\$\^|_|args|DebugPreference|Error|ErrorActionPreference|foreach|Home|Input|LASTEXITCODE|MaximumAliasCount|MaximumDriveCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|PsHome|Host|OFS|ReportErrorShowExceptionClass|ReportErrorShowInnerException|ReportErrorShowSource|ReportErrorShowStackTrace|ShouldProcessPreference|ShouldProcessReturnPreference|StackTrace|VerbosePreference|WarningPreference|PWD)', |
247 GESHI_SEARCH => '(\$)(\$[_\^]?|\?)(?!\w)', |
237 GESHI_REPLACE => '\1\2', |
248 GESHI_REPLACE => '\1\2', |
238 GESHI_MODIFIERS => '', |
249 GESHI_MODIFIERS => '', |
239 GESHI_BEFORE => '', |
250 GESHI_BEFORE => '', |
240 GESHI_AFTER => '\3' |
251 GESHI_AFTER => '' |
241 ), |
252 ), |
|
253 // variables |
|
254 //BenBE: Please note that changes here and in Keyword group 6 have to be synchronized in order to work properly. |
|
255 //This Regexp must only match, if keyword group 6 doesn't. If this assumption fails |
|
256 //Highlighting of the keywords will be incomplete or incorrect! |
|
257 0 => "(?<!\\\$|>)[\\\$](\w+)(?=[^|\w])", |
242 ), |
258 ), |
243 'STRICT_MODE_APPLIES' => GESHI_NEVER, |
259 'STRICT_MODE_APPLIES' => GESHI_NEVER, |
244 'SCRIPT_DELIMITERS' => array( |
260 'SCRIPT_DELIMITERS' => array( |
245 ), |
261 ), |
246 'HIGHLIGHT_STRICT_BLOCK' => array( |
262 'HIGHLIGHT_STRICT_BLOCK' => array( |
247 ), |
263 ), |
|
264 'PARSER_CONTROL' => array( |
|
265 'KEYWORDS' => array( |
|
266 4 => array( |
|
267 'DISALLOWED_AFTER' => '(?![a-zA-Z])', |
|
268 'DISALLOWED_BEFORE' => '' |
|
269 ), |
|
270 6 => array( |
|
271 'DISALLOWED_BEFORE' => '(?<!\$>)\$' |
|
272 ) |
|
273 ) |
|
274 ) |
248 ); |
275 ); |
249 |
276 |
250 ?> |
277 ?> |