powershell.jsf (6024B)
1 # PowerShell syntax highlighting for Joe's Own Editor 2 # Oskar Liljeblad <oskar@osk.mine.nu>, 2014-02-11 3 # 4 # PowerShell is the poor man's[1] replacement for a real shell such as Bash. 5 # [1] Someone who has to use Windows for whatever reason. 6 # 7 # Reference: http://www.microsoft.com/en-us/download/details.aspx?id=36389 8 # Status: 9 # 1 100% 10 # 2.1 100% 11 # 2.2.1 100% except signature support 12 # 2.2.2 100% 13 # 2.2.3 100% except requires support 14 # 2.2.4 100% 15 # 2.3.1 100% 16 # 2.3.2 100% except automatic variables 17 # 2.3.3 100% no coloring 18 # 2.3.4 100% no coloring 19 # 2.3.5 100% no coloring 20 # 2.3.6 100% 21 22 =Idle 23 =Ident 24 =Comment 25 =Constant 26 =Number +Constant 27 =Boolean +Constant 28 =String +Constant 29 =StringEscape +Escape 30 =StringVariable +StringEscape 31 =Keyword 32 =Type 33 =Operator +Keyword 34 =Statement +Keyword 35 =Structure +Statement 36 =Conditional +Statement 37 =Loop +Statement 38 =Variable +DefinedIdent 39 =VariableEscape +Escape 40 41 =ParamKey +Attr +Operator 42 43 :idle Idle 44 * idle 45 "#" comment recolor=-1 46 "$" var recolor=-1 mark 47 "@" var_array recolor=-1 48 "<" idle1 49 "[" typespec 50 "\"" string_dq recolor=-1 51 "'" string_sq recolor=-1 52 "@" idle2 53 "a-zA-Z_" ident buffer 54 "-" param recolor=-1 55 56 :idle1 Idle 57 * idle noeat 58 "#" delim_comment recolor=-2 59 60 :idle2 Idle 61 * idle noeat 62 "\"" herestr_dq recolor=-2 63 "'" herestr_sq recolor=-2 64 65 :comment Comment comment 66 * comment 67 "BFHNTX" comment noeat call=comment_todo.comment_todo() 68 "\r\n" idle 69 70 :var_array Variable 71 * idle noeat 72 "$?^" idle mark 73 "a-zA-Z_" var_name 74 75 :var Variable 76 * idle noeat 77 "{" var_brack 78 "$?^" idle 79 "a-zA-Z_" var_name buffer 80 81 :var_name Variable 82 * idle noeat recolor=-1 istrings 83 "true" bool recolormark markend 84 "false" bool recolormark markend 85 "null" kw recolormark markend 86 done 87 "a-zA-Z0-9_:?" var_name 88 89 :bool Boolean 90 * idle 91 92 :var_brack Variable 93 * var_brack 94 "`" var_escape recolor=-1 95 "}" idle 96 97 :var_escape VariableEscape 98 * var_brack 99 100 :delim_comment Comment comment 101 * delim_comment 102 "BFHNTX" delim_comment noeat call=comment_todo.comment_todo() 103 "#" delim_comment1 104 105 :delim_comment1 Comment comment 106 * delim_comment noeat 107 ">" idle 108 109 :string_dq String string 110 * string_dq 111 "\"\n" idle 112 "$" string_dq_subst recolor=-1 113 "`" string_dq_esc recolor=-1 114 115 :string_dq_subst StringVariable string 116 * string_dq noeat recolor=-2 117 "a-zA-Z_" string_dq_subst_name 118 "{" string_dq_subst_brack 119 "(" string_dq_subst_parens 120 "`" string_dq_subst_escape recolor=-1 121 122 :string_dq_subst_name StringVariable string 123 * string_dq recolor=-1 noeat 124 "a-zA-Z0-9_:" string_dq_subst_name 125 "`" string_dq_subst_escape recolor=-1 126 127 :string_dq_subst_escape VariableEscape string 128 * string_dq_subst_name 129 130 :string_dq_subst_brack Variable string 131 * string_dq_subst_brack 132 "}" string_dq 133 134 :string_dq_subst_parens Variable string 135 * string_dq_sustr_parens 136 ")" string_dq 137 138 :string_sq String string 139 * string_sq 140 "\'\n" idle 141 142 :string_dq_esc StringEscape string 143 * string_dq 144 145 :string_sq_esc StringEscape string 146 * string_sq 147 148 :herestr_dq String string 149 * herestr_dq 150 "\"" herestr_dq1 151 "$" herestr_dq_subst recolor=-1 152 153 :herestr_dq1 String string 154 * herestr_dq noeat 155 "@" idle 156 157 :herestr_dq_subst Variable string 158 * herestr_dq noeat recolor=-2 159 "a-zA-Z_" herestr_dq_subst_name 160 "(" herestr_dq_subst_parens 161 "`" herestr_dq_subst_escape recolor=-1 162 163 :herestr_dq_subst_name Variable string 164 * herestr_dq recolor=-1 noeat 165 "a-zA-Z0-9_:" herestr_dq_subst_name 166 "`" herestr_dq_subst_escape recolor=-1 167 168 :herestr_dq_subst_escape VariableEscape string 169 * herestr_dq_subst_name 170 171 :herestr_dq_subst_parens Variable string 172 * herestr_dq_subst_parens 173 ")" herestr_dq 174 175 :herestr_sq String string 176 * herestr_sq 177 "\'" herestr_sq1 178 179 :herestr_sq1 String string 180 * herestr_sq noeat 181 "@" idle 182 183 :typespec_start Idle 184 * idle noeat 185 "\s" typespec_start 186 "\i.:" typespec noeat 187 188 :typespec Type 189 * idle noeat 190 "\i.:\s" typespec 191 "[" typespec_brack 192 193 :typespec_brack Type 194 * typespec noeat 195 "\s" typespec_brack 196 "]" typespec 197 198 :param ParamKey 199 * after_param noeat istrings 200 "-and" oper 201 "-band" oper 202 "-bnot" oper 203 "-bor" oper 204 "-bxor" oper 205 "-not" oper 206 "-or" oper 207 "-xor" oper 208 "-f" oper 209 "-as" oper 210 "-ccontains" oper 211 "-ceq" oper 212 "-cge" oper 213 "-cgt" oper 214 "-cle" oper 215 "-clike" oper 216 "-clt" oper 217 "-cmatch" oper 218 "-cne" oper 219 "-cnotcontains" oper 220 "-cnotlike" oper 221 "-cnotmatch" oper 222 "-contains" oper 223 "-creplace" oper 224 "-csplit" oper 225 "-eq" oper 226 "-ge" oper 227 "-gt" oper 228 "-icontains" oper 229 "-ieq" oper 230 "-ige" oper 231 "-igt" oper 232 "-ile" oper 233 "-ilike" oper 234 "-ilt" oper 235 "-imatch" oper 236 "-in" oper 237 "-ine" oper 238 "-inotcontains" oper 239 "-inotlike" oper 240 "-inotmatch" oper 241 "-ireplace" oper 242 "-is" oper 243 "-isnot" oper 244 "-isplit" oper 245 "-join" oper 246 "-le" oper 247 "-like" oper 248 "-lt" oper 249 "-match" oper 250 "-ne" oper 251 "-notcontains" oper 252 "-notin" oper 253 "-notlike" oper 254 "-notmatch" oper 255 "-replace" oper 256 "-shl" oper 257 "-shr" oper 258 "-split" oper 259 done 260 "a-zA-Z_" param 261 262 :after_param Ident 263 * herestr_noq noeat 264 " \t" after_param 265 266 # Unquoted strings (after -parameter key) 267 :herestr_noq String string 268 * idle noeat 269 " \t\r\n" idle recolor=-1 270 "\i" herestr_noq 271 272 # After an operator, we do not assume what follows is an unquoted string. 273 :oper Operator 274 * idle noeat 275 276 :ident Ident 277 * idle noeat istrings 278 "begin" kw 279 "break" loop 280 "catch" kw 281 "class" struct 282 "continue" loop 283 "data" kw 284 "define" kw 285 "do" loop 286 "dynamicparam" struct 287 "else" cond 288 "elseif" cond 289 "end" kw 290 "exit" stmt 291 "filter" kw 292 "finally" kw 293 "for" loop 294 "foreach" loop 295 "from" kw 296 "function" struct 297 "if" cond 298 "in" kw 299 "inlinescript" kw 300 "parallel" kw 301 "param" struct 302 "process" kw 303 "return" stmt 304 "switch" cond 305 "throw" kw 306 "trap" kw 307 "try" kw 308 "until" loop 309 "using" kw 310 "var" kw 311 "while" loop 312 "workflow" kw 313 done 314 "a-zA-Z_\-" ident 315 316 :kw Keyword 317 * idle noeat 318 319 :loop Loop 320 * idle noeat 321 322 :cond Conditional 323 * idle noeat 324 325 :stmt Statement 326 * idle noeat 327 328 :struct Structure 329 * idle noeat