| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY tab "	"> |
| 5 |
<!ENTITY funcname "([^&_fragpathseps;}=#$]|[+!@](?!\())([^&_fragpathseps;}=$]*+([+!@](?!\())?+)*+"> |
| 6 |
<!ENTITY varname "[A-Za-z_][A-Za-z0-9_]*"> |
| 7 |
<!ENTITY eos "(?=$|[ &tab;])"> <!-- eol or space following --> |
| 8 |
<!ENTITY eoexpr "(?=$|[ &tab;<>|&;)])"> |
| 9 |
|
| 10 |
<!ENTITY substseps "${'"`\\"> |
| 11 |
<!ENTITY symbolseps "<>|&;()"> <!-- see man bash --> |
| 12 |
<!ENTITY wordseps " &tab;&symbolseps;"> <!-- see man bash --> |
| 13 |
|
| 14 |
<!ENTITY bq_string "`[^`]*+`"> |
| 15 |
<!ENTITY sq_string "'[^']*+'"> |
| 16 |
<!ENTITY dq_string ""(?:[^"\\`]*+|&bq_string;|\\.)*+""> |
| 17 |
<!ENTITY strings "(?:&sq_string;|&dq_string;|&bq_string;)"> |
| 18 |
|
| 19 |
<!ENTITY globany "\[(?:[^&wordseps;"'`\\\[\]]+|\\.|&strings;|\[:\w+:\]|\[)*\]"> |
| 20 |
|
| 21 |
<!ENTITY next_is_globany "(?:\^?\]\]|(?:\^?\]?)?(?:\\.|[^'" &tab;<>|&;()\\[\]]+|&strings;|\[:\w+:\])+\])"> |
| 22 |
<!ENTITY bracket_noglobany "\[(?!&next_is_globany;)"> |
| 23 |
|
| 24 |
<!ENTITY _fragpathseps "*?+!@&wordseps;&substseps;"> |
| 25 |
<!ENTITY _fragpathnosep "(?:[+!@](?!\()|\\.|&_brace_noexpansion;)?+"> |
| 26 |
<!ENTITY path "(?:[^&_fragpathseps;\[]*+&_fragpathnosep;)*+"> |
| 27 |
<!ENTITY fragpath "(?:[^&_fragpathseps;\[/]*+&_fragpathnosep;)*+"> |
| 28 |
<!ENTITY opt "(?:[^&_fragpathseps;\[=/]*+&_fragpathnosep;)*+"> |
| 29 |
<!ENTITY pathpart "(?:~|\.\.?|&fragpath;)(?:/&path;|(?=[*?]|[+!@]\(|&fragpath;(?:[/*?]|\[&next_is_globany;|[+!@]\()))|(?:~|\.\.?)(?=[&wordseps;]|$)"> |
| 30 |
|
| 31 |
<!ENTITY _fragpathseps_alt "*?+!@&substseps;}"> |
| 32 |
<!ENTITY _fragpathnosep_alt "(?:[+!@](?!\()|\\.)?+"> |
| 33 |
<!ENTITY path_alt "(?:[^&_fragpathseps_alt;]*+&_fragpathnosep_alt;)*+"> |
| 34 |
<!ENTITY fragpath_alt "(?:[^&_fragpathseps_alt;/]*+&_fragpathnosep_alt;)*+"> |
| 35 |
<!ENTITY opt_alt "(?:[^&_fragpathseps_alt;=/]*+&_fragpathnosep_alt;)*+"> |
| 36 |
<!ENTITY pathpart_alt "(?:~|\.\.?|&fragpath_alt;)(?:/&path_alt;|(?=[*?]|[+!@]\(|&fragpath_alt;(?:[/*?]|[+!@]\()))|(?:~|\.\.?)(?=\}|$)"> |
| 37 |
|
| 38 |
<!-- Path only with / --> |
| 39 |
<!ENTITY path_with_sep_text "[^?*+!@&wordseps;'"`\\/]"> |
| 40 |
<!ENTITY path_with_sep_text2 "[^?*+!@()'"`\\/]"> |
| 41 |
<!ENTITY path_with_sep_expr "\\.|&strings;|&globany;|[?*+](?!\()"> |
| 42 |
<!ENTITY path_with_sep_spe "(~|\.\.?)($|[/ &tab;<>|&;)])"> |
| 43 |
<!ENTITY path_with_sep_sub "[?*+!@]\((&path_with_sep_text2;++|&path_with_sep_expr;)*+(\)|(?=/))"> |
| 44 |
<!ENTITY path_with_sep "/|&path_with_sep_spe;|(&path_with_sep_text;++|&path_with_sep_expr;|&path_with_sep_sub;)*+/"> |
| 45 |
|
| 46 |
<!ENTITY _braceexpansion_spe " &tab;<>|&;{}\\`'"$"> |
| 47 |
<!ENTITY _brace_noexpansion "\{[^&_braceexpansion_spe;,]*+\}"> |
| 48 |
<!ENTITY _braceexpansion_var "\$(?:\{[^\[\]&_braceexpansion_spe;]*+(?:\[[*@a-zA-Z0-9]\])\})?"> |
| 49 |
<!ENTITY _braceexpansion_string "'[^']*'|"([^"\`]*+|`[^`]*`)*+""> |
| 50 |
<!ENTITY _braceexpansion_elems "\\.|`[^`]*`|&_braceexpansion_string;|&_braceexpansion_var;|&_brace_noexpansion;"> |
| 51 |
<!ENTITY _braceexpansion_consume "&_braceexpansion_elems;|{(?:[^&_braceexpansion_spe;,]++|&_braceexpansion_elems;)*?}|(?R)?+"> |
| 52 |
<!ENTITY _braceexpansion "(?:[^&_braceexpansion_spe;,]++|&_braceexpansion_consume;)*?,(?:[^&_braceexpansion_spe;]++|&_braceexpansion_consume;)*?}"> |
| 53 |
<!ENTITY braceexpansion "{&_braceexpansion;"> |
| 54 |
|
| 55 |
<!ENTITY heredocq "(?|"([^"]+)"|'([^']+)'|\\(.[^&wordseps;&substseps;]*))"> |
| 56 |
|
| 57 |
<!ENTITY arithmetic_as_subshell "\(((?:[^`'"()$]++|\$\{[^`'"(){}$]+\}|\$(?=[^{`'"()])|`[^`]*+`|\((?1)(?:[)]|(?=['"])))++)(?:[)](?=$|[^)])|["'])"> |
| 58 |
|
| 59 |
<!ENTITY unary_operators "-[abcdefghkprstuwxGLNOSovRnz]&eos;"> |
| 60 |
<!ENTITY binary_operators "(?:-(?:e[fq]|[nolg]t|[nlg]e)|==?|!=)&eos;"> |
| 61 |
|
| 62 |
<!ENTITY dblbracket_close "\]\](?=($|[ &tab;;|&)]))"> |
| 63 |
|
| 64 |
<!ENTITY weakDeliminatorSymbols "^%#[]$.{}:-/"> |
| 65 |
]> |
| 66 |
|
| 67 |
<language |
| 68 |
name="Bash" |
| 69 |
version="47" |
| 70 |
kateversion="5.79" |
| 71 |
section="Scripts" |
| 72 |
extensions="*.sh;*.bash;*.ebuild;*.eclass;*.exlib;*.exheres-0;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD;APKBUILD" |
| 73 |
mimetype="application/x-shellscript" |
| 74 |
casesensitive="1" |
| 75 |
author="Wilbert Berendsen ([email protected])" |
| 76 |
license="LGPL" |
| 77 |
> |
| 78 |
|
| 79 |
<!-- (c) 2004 by Wilbert Berendsen ([email protected]) |
| 80 |
Changes by Matthew Woehlke ([email protected]) |
| 81 |
Changes by Sebastian Pipping ([email protected]) |
| 82 |
Changes by Luiz Angelo Daros de Luca ([email protected]) |
| 83 |
Released under the LGPL, part of kdelibs/kate --> |
| 84 |
|
| 85 |
<highlighting> |
| 86 |
<list name="keywords"> |
| 87 |
<item>break</item> |
| 88 |
<item>case</item> |
| 89 |
<item>continue</item> |
| 90 |
<item>do</item> |
| 91 |
<item>done</item> |
| 92 |
<item>elif</item> |
| 93 |
<item>else</item> |
| 94 |
<item>esac</item> |
| 95 |
<item>fi</item> |
| 96 |
<item>for</item> |
| 97 |
<item>function</item> |
| 98 |
<item>if</item> |
| 99 |
<item>in</item> |
| 100 |
<item>return</item> |
| 101 |
<item>select</item> |
| 102 |
<item>then</item> |
| 103 |
<item>until</item> |
| 104 |
<item>while</item> |
| 105 |
</list> |
| 106 |
|
| 107 |
<list name="builtins"> |
| 108 |
<item>.</item> |
| 109 |
<item>:</item> |
| 110 |
<item>source</item> |
| 111 |
<item>alias</item> |
| 112 |
<item>bg</item> |
| 113 |
<item>bind</item> |
| 114 |
<item>builtin</item> |
| 115 |
<item>cd</item> |
| 116 |
<item>caller</item> |
| 117 |
<item>command</item> |
| 118 |
<item>compgen</item> |
| 119 |
<item>complete</item> |
| 120 |
<item>coproc</item> |
| 121 |
<item>dirs</item> |
| 122 |
<item>disown</item> |
| 123 |
<item>echo</item> |
| 124 |
<item>enable</item> |
| 125 |
<item>eval</item> |
| 126 |
<item>exec</item> |
| 127 |
<item>exit</item> |
| 128 |
<item>fc</item> |
| 129 |
<item>fg</item> |
| 130 |
<item>hash</item> |
| 131 |
<item>help</item> |
| 132 |
<item>history</item> |
| 133 |
<item>jobs</item> |
| 134 |
<item>kill</item> |
| 135 |
<item>logout</item> |
| 136 |
<item>popd</item> |
| 137 |
<item>printf</item> |
| 138 |
<item>pushd</item> |
| 139 |
<item>pwd</item> |
| 140 |
<item>set</item> |
| 141 |
<item>shift</item> |
| 142 |
<item>shopt</item> |
| 143 |
<item>suspend</item> |
| 144 |
<item>test</item> |
| 145 |
<item>time</item> |
| 146 |
<item>times</item> |
| 147 |
<item>trap</item> |
| 148 |
<item>type</item> |
| 149 |
<item>ulimit</item> |
| 150 |
<item>umask</item> |
| 151 |
<item>unalias</item> |
| 152 |
<item>wait</item> |
| 153 |
</list> |
| 154 |
|
| 155 |
<list name="builtins_var"> |
| 156 |
<item>export</item> |
| 157 |
<item>declare</item> |
| 158 |
<item>getopts</item> |
| 159 |
<item>let</item> |
| 160 |
<item>local</item> |
| 161 |
<item>read</item> |
| 162 |
<item>readonly</item> |
| 163 |
<item>typeset</item> |
| 164 |
<item>unset</item> |
| 165 |
</list> |
| 166 |
|
| 167 |
<list name="unixcommands"> |
| 168 |
<!-- /bin --> |
| 169 |
<item>arch</item> |
| 170 |
<item>awk</item> |
| 171 |
<item>b2sum</item> |
| 172 |
<item>base32</item> |
| 173 |
<item>base64</item> |
| 174 |
<item>bash</item> |
| 175 |
<item>bunzip2</item> |
| 176 |
<item>bzcat</item> |
| 177 |
<item>bzcmp</item> |
| 178 |
<item>bzdiff</item> |
| 179 |
<item>bzegrep</item> |
| 180 |
<item>bzfgrep</item> |
| 181 |
<item>bzgrep</item> |
| 182 |
<item>bzip2</item> |
| 183 |
<item>bzip2recover</item> |
| 184 |
<item>bzless</item> |
| 185 |
<item>bzmore</item> |
| 186 |
<item>cat</item> |
| 187 |
<item>chattr</item> |
| 188 |
<item>chcon</item> |
| 189 |
<item>chgrp</item> |
| 190 |
<item>chmod</item> |
| 191 |
<item>chown</item> |
| 192 |
<item>chvt</item> |
| 193 |
<item>cksum</item> |
| 194 |
<item>cp</item> |
| 195 |
<item>crontab</item> |
| 196 |
<item>csplit</item> |
| 197 |
<item>date</item> |
| 198 |
<item>dd</item> |
| 199 |
<item>deallocvt</item> |
| 200 |
<item>df</item> |
| 201 |
<item>dir</item> |
| 202 |
<item>dircolors</item> |
| 203 |
<item>dmesg</item> |
| 204 |
<item>dnsdomainname</item> |
| 205 |
<item>domainname</item> |
| 206 |
<item>du</item> |
| 207 |
<item>dumpkeys</item> |
| 208 |
<item>ed</item> |
| 209 |
<item>egrep</item> |
| 210 |
<item>expand</item> |
| 211 |
<item>false</item> |
| 212 |
<item>fgconsole</item> |
| 213 |
<item>fgrep</item> |
| 214 |
<item>fold</item> |
| 215 |
<item>fuser</item> |
| 216 |
<item>gawk</item> |
| 217 |
<item>getkeycodes</item> |
| 218 |
<item>gocr</item> |
| 219 |
<item>grep</item> |
| 220 |
<item>groff</item> |
| 221 |
<item>groups</item> |
| 222 |
<item>gunzip</item> |
| 223 |
<item>gzexe</item> |
| 224 |
<item>gzip</item> |
| 225 |
<item>hostid</item> |
| 226 |
<item>hostname</item> |
| 227 |
<item>iconv</item> |
| 228 |
<item>igawk</item> |
| 229 |
<item>install</item> |
| 230 |
<item>kbd_mode</item> |
| 231 |
<item>kbdrate</item> |
| 232 |
<item>killall</item> |
| 233 |
<item>last</item> |
| 234 |
<item>lastb</item> |
| 235 |
<item>link</item> |
| 236 |
<item>ln</item> |
| 237 |
<item>loadkeys</item> |
| 238 |
<item>loadunimap</item> |
| 239 |
<item>login</item> |
| 240 |
<item>ls</item> |
| 241 |
<item>lsattr</item> |
| 242 |
<item>lsmod</item> |
| 243 |
<item>lsmod.old</item> |
| 244 |
<item>lzcat</item> |
| 245 |
<item>lzcmp</item> |
| 246 |
<item>lzdiff</item> |
| 247 |
<item>lzegrep</item> |
| 248 |
<item>lzfgrep</item> |
| 249 |
<item>lzgrep</item> |
| 250 |
<item>lzless</item> |
| 251 |
<item>lzma</item> |
| 252 |
<item>lzmainfo</item> |
| 253 |
<item>lzmore</item> |
| 254 |
<item>mapscrn</item> |
| 255 |
<item>md5sum</item> |
| 256 |
<item>mesg</item> |
| 257 |
<item>mkdir</item> |
| 258 |
<item>mkfifo</item> |
| 259 |
<item>mknod</item> |
| 260 |
<item>mktemp</item> |
| 261 |
<item>more</item> |
| 262 |
<item>mount</item> |
| 263 |
<item>mv</item> |
| 264 |
<item>nano</item> |
| 265 |
<item>netstat</item> |
| 266 |
<item>nisdomainname</item> |
| 267 |
<item>nproc</item> |
| 268 |
<item>nroff</item> |
| 269 |
<item>numfmt</item> |
| 270 |
<item>openvt</item> |
| 271 |
<item>paste</item> |
| 272 |
<item>pathchk</item> |
| 273 |
<item>pgawk</item> |
| 274 |
<item>pidof</item> |
| 275 |
<item>ping</item> |
| 276 |
<item>pinky</item> |
| 277 |
<item>printenv</item> |
| 278 |
<item>ps</item> |
| 279 |
<item>pstree</item> |
| 280 |
<item>ptx</item> |
| 281 |
<item>rbash</item> |
| 282 |
<item>readlink</item> |
| 283 |
<item>realpath</item> |
| 284 |
<item>red</item> |
| 285 |
<item>resizecons</item> |
| 286 |
<item>rm</item> |
| 287 |
<item>rmdir</item> |
| 288 |
<item>run-parts</item> |
| 289 |
<item>runcon</item> |
| 290 |
<item>sash</item> |
| 291 |
<item>sed</item> |
| 292 |
<item>setfont</item> |
| 293 |
<item>setkeycodes</item> |
| 294 |
<item>setleds</item> |
| 295 |
<item>setmetamode</item> |
| 296 |
<item>setserial</item> |
| 297 |
<item>sh</item> |
| 298 |
<item>sha1sum</item> |
| 299 |
<item>sha224sum</item> |
| 300 |
<item>sha256sum</item> |
| 301 |
<item>sha384sum</item> |
| 302 |
<item>sha512sum</item> |
| 303 |
<item>showkey</item> |
| 304 |
<item>shred</item> |
| 305 |
<item>shuf</item> |
| 306 |
<item>sleep</item> |
| 307 |
<item>ssed</item> |
| 308 |
<item>stat</item> |
| 309 |
<item>stdbuf</item> |
| 310 |
<item>stty</item> |
| 311 |
<item>su</item> |
| 312 |
<item>sync</item> |
| 313 |
<item>tar</item> |
| 314 |
<item>tempfile</item> |
| 315 |
<item>timeout</item> |
| 316 |
<item>touch</item> |
| 317 |
<item>tput</item> |
| 318 |
<item>troff</item> |
| 319 |
<item>true</item> |
| 320 |
<item>truncate</item> |
| 321 |
<item>tty</item> |
| 322 |
<item>umount</item> |
| 323 |
<item>uname</item> |
| 324 |
<item>unexpand</item> |
| 325 |
<item>unicode_start</item> |
| 326 |
<item>unicode_stop</item> |
| 327 |
<item>unlink</item> |
| 328 |
<item>unlzma</item> |
| 329 |
<item>unxz</item> |
| 330 |
<item>utmpdump</item> |
| 331 |
<item>uuidgen</item> |
| 332 |
<item>vdir</item> |
| 333 |
<item>vi</item> |
| 334 |
<item>wall</item> |
| 335 |
<item>wc</item> |
| 336 |
<item>xz</item> |
| 337 |
<item>xzcat</item> |
| 338 |
<item>ypdomainname</item> |
| 339 |
<item>zcat</item> |
| 340 |
<item>zcmp</item> |
| 341 |
<item>zdiff</item> |
| 342 |
<item>zegrep</item> |
| 343 |
<item>zfgrep</item> |
| 344 |
<item>zforce</item> |
| 345 |
<item>zgrep</item> |
| 346 |
<item>zless</item> |
| 347 |
<item>zmore</item> |
| 348 |
<item>znew</item> |
| 349 |
<item>zsh</item> |
| 350 |
|
| 351 |
<!-- some from /usr/bin --> |
| 352 |
<item>aclocal</item> |
| 353 |
<item>aconnect</item> |
| 354 |
<item>aplay</item> |
| 355 |
<item>apm</item> |
| 356 |
<item>apmsleep</item> |
| 357 |
<item>apropos</item> |
| 358 |
<item>ar</item> |
| 359 |
<item>arecord</item> |
| 360 |
<item>as</item> |
| 361 |
<item>as86</item> |
| 362 |
<item>autoconf</item> |
| 363 |
<item>autoheader</item> |
| 364 |
<item>automake</item> |
| 365 |
<item>basename</item> |
| 366 |
<item>bc</item> |
| 367 |
<item>bison</item> |
| 368 |
<item>c++</item> |
| 369 |
<item>cal</item> |
| 370 |
<item>cc</item> |
| 371 |
<item>cdda2wav</item> |
| 372 |
<item>cdparanoia</item> |
| 373 |
<item>cdrdao</item> |
| 374 |
<item>cd-read</item> |
| 375 |
<item>cdrecord</item> |
| 376 |
<item>chfn</item> |
| 377 |
<item>chroot</item> |
| 378 |
<item>chsh</item> |
| 379 |
<item>clear</item> |
| 380 |
<item>cmp</item> |
| 381 |
<item>co</item> |
| 382 |
<item>col</item> |
| 383 |
<item>comm</item> |
| 384 |
<item>cpio</item> |
| 385 |
<item>cpp</item> |
| 386 |
<item>cut</item> |
| 387 |
<item>dc</item> |
| 388 |
<item>diff</item> |
| 389 |
<item>diff3</item> |
| 390 |
<item>directomatic</item> |
| 391 |
<item>dirname</item> |
| 392 |
<item>env</item> |
| 393 |
<item>expr</item> |
| 394 |
<item>fbset</item> |
| 395 |
<item>file</item> |
| 396 |
<item>find</item> |
| 397 |
<item>flex</item> |
| 398 |
<item>flex++</item> |
| 399 |
<item>fmt</item> |
| 400 |
<item>free</item> |
| 401 |
<item>ftp</item> |
| 402 |
<item>funzip</item> |
| 403 |
<item>g++</item> |
| 404 |
<item>gc</item> |
| 405 |
<item>gcc</item> |
| 406 |
<item>clang</item> |
| 407 |
<item>clang++</item> |
| 408 |
<item>valgrind</item> |
| 409 |
<item>xdg-open</item> |
| 410 |
<item>cmake</item> |
| 411 |
<item>qmake</item> |
| 412 |
<item>svn</item> |
| 413 |
<item>git</item> |
| 414 |
<item>rsync</item> |
| 415 |
<item>gdb</item> |
| 416 |
<item>getent</item> |
| 417 |
<item>getopt</item> |
| 418 |
<item>gettext</item> |
| 419 |
<item>gettextize</item> |
| 420 |
<item>gimp</item> |
| 421 |
<item>gimp-remote</item> |
| 422 |
<item>gimptool</item> |
| 423 |
<item>gmake</item> |
| 424 |
<item>gs</item> |
| 425 |
<item>head</item> |
| 426 |
<item>hexdump</item> |
| 427 |
<item>id</item> |
| 428 |
<item>join</item> |
| 429 |
<item>ld</item> |
| 430 |
<item>ld86</item> |
| 431 |
<item>ldd</item> |
| 432 |
<item>less</item> |
| 433 |
<item>lex</item> |
| 434 |
<item>locate</item> |
| 435 |
<item>lockfile</item> |
| 436 |
<item>logname</item> |
| 437 |
<item>lp</item> |
| 438 |
<item>lpr</item> |
| 439 |
<item>lynx</item> |
| 440 |
<item>m4</item> |
| 441 |
<item>make</item> |
| 442 |
<item>man</item> |
| 443 |
<item>msgfmt</item> |
| 444 |
<item>namei</item> |
| 445 |
<item>nasm</item> |
| 446 |
<item>nawk</item> |
| 447 |
<item>nice</item> |
| 448 |
<item>nl</item> |
| 449 |
<item>nm</item> |
| 450 |
<item>nm86</item> |
| 451 |
<item>nmap</item> |
| 452 |
<item>nohup</item> |
| 453 |
<item>nop</item> |
| 454 |
<item>od</item> |
| 455 |
<item>passwd</item> |
| 456 |
<item>patch</item> |
| 457 |
<item>pcregrep</item> |
| 458 |
<item>pcretest</item> |
| 459 |
<item>perl</item> |
| 460 |
<item>perror</item> |
| 461 |
<item>pr</item> |
| 462 |
<item>procmail</item> |
| 463 |
<item>prune</item> |
| 464 |
<item>ps2ascii</item> |
| 465 |
<item>ps2epsi</item> |
| 466 |
<item>ps2frag</item> |
| 467 |
<item>ps2pdf</item> |
| 468 |
<item>ps2ps</item> |
| 469 |
<item>psbook</item> |
| 470 |
<item>psmerge</item> |
| 471 |
<item>psnup</item> |
| 472 |
<item>psresize</item> |
| 473 |
<item>psselect</item> |
| 474 |
<item>pstops</item> |
| 475 |
<item>rcs</item> |
| 476 |
<item>rev</item> |
| 477 |
<item>scp</item> |
| 478 |
<item>seq</item> |
| 479 |
<item>setterm</item> |
| 480 |
<item>size</item> |
| 481 |
<item>size86</item> |
| 482 |
<item>skill</item> |
| 483 |
<item>slogin</item> |
| 484 |
<item>snice</item> |
| 485 |
<item>sort</item> |
| 486 |
<item>sox</item> |
| 487 |
<item>split</item> |
| 488 |
<item>ssh</item> |
| 489 |
<item>ssh-add</item> |
| 490 |
<item>ssh-agent</item> |
| 491 |
<item>ssh-keygen</item> |
| 492 |
<item>ssh-keyscan</item> |
| 493 |
<item>strings</item> |
| 494 |
<item>strip</item> |
| 495 |
<item>sudo</item> |
| 496 |
<item>suidperl</item> |
| 497 |
<item>sum</item> |
| 498 |
<item>tac</item> |
| 499 |
<item>tail</item> |
| 500 |
<item>tee</item> |
| 501 |
<item>tr</item> |
| 502 |
<item>tsort</item> |
| 503 |
<item>uniq</item> |
| 504 |
<item>unzip</item> |
| 505 |
<item>updatedb</item> |
| 506 |
<item>updmap</item> |
| 507 |
<item>uptime</item> |
| 508 |
<item>users</item> |
| 509 |
<item>vmstat</item> |
| 510 |
<item>w</item> |
| 511 |
<item>wget</item> |
| 512 |
<item>whatis</item> |
| 513 |
<item>whereis</item> |
| 514 |
<item>which</item> |
| 515 |
<item>who</item> |
| 516 |
<item>whoami</item> |
| 517 |
<item>write</item> |
| 518 |
<item>xargs</item> |
| 519 |
<item>yacc</item> |
| 520 |
<item>yes</item> |
| 521 |
<item>zip</item> |
| 522 |
<item>zsoelim</item> |
| 523 |
|
| 524 |
<!-- others --> |
| 525 |
<item>dcop</item> |
| 526 |
<item>kdialog</item> |
| 527 |
<item>kfile</item> |
| 528 |
<item>xhost</item> |
| 529 |
<item>xmodmap</item> |
| 530 |
<item>xset</item> |
| 531 |
</list> |
| 532 |
|
| 533 |
|
| 534 |
<contexts> |
| 535 |
<context attribute="Normal Text" lineEndContext="#stay" name="Start" fallthroughContext="Command"> |
| 536 |
<IncludeRules context="BashOneLine"/> |
| 537 |
</context> |
| 538 |
|
| 539 |
<!-- used by other syntaxes --> |
| 540 |
<context attribute="Normal Text" lineEndContext="#pop" name="FindOneLineBackq" fallthroughContext="#pop"> |
| 541 |
<DetectChar attribute="Backquote" context="OneLineBackq" char="`"/> |
| 542 |
</context> |
| 543 |
<context attribute="Normal Text" lineEndContext="#stay" name="OneLineBackq" fallthroughContext="Command"> |
| 544 |
<DetectChar attribute="Backquote" context="#pop" char="`"/> |
| 545 |
<IncludeRules context="Start"/> |
| 546 |
</context> |
| 547 |
|
| 548 |
<context attribute="Normal Text" lineEndContext="#pop" name="BashOneLine" fallthroughContext="Command"> |
| 549 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 550 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 551 |
<!-- start expression in double parentheses --> |
| 552 |
<Detect2Chars context="ExprDblParenOrSubShell" char="(" char1="(" lookAhead="1"/> |
| 553 |
<!-- start a subshell --> |
| 554 |
<DetectChar attribute="Keyword" context="SubShell" char="(" beginRegion="subshell"/> |
| 555 |
<!-- start expression in single/double brackets --> |
| 556 |
<DetectChar context="MaybeBracketExpression" char="[" lookAhead="1"/> |
| 557 |
<!-- start a group command or BraceExpansion with { --> |
| 558 |
<DetectChar context="MaybeGroup" char="{" lookAhead="1"/> |
| 559 |
|
| 560 |
<!-- handle ` --> |
| 561 |
<DetectChar attribute="Backquote" context="CommandBackq" char="`"/> |
| 562 |
|
| 563 |
<!-- &> and &>> redirection --> |
| 564 |
<StringDetect attribute="Redirection" context="WordRedirection" String="&>>"/> |
| 565 |
<Detect2Chars attribute="Redirection" context="FdRedirection" char="&" char1=">"/> |
| 566 |
|
| 567 |
<!-- handle branche conditions --> |
| 568 |
<Detect2Chars attribute="Control" context="#stay" char="&" char1="&"/> |
| 569 |
<Detect2Chars attribute="Control" context="#stay" char="|" char1="|"/> |
| 570 |
|
| 571 |
<!-- handle &, |, ; --> |
| 572 |
<AnyChar attribute="Control" context="#stay" String="&|;"/> |
| 573 |
|
| 574 |
<!-- handle variable assignments --> |
| 575 |
<RegExpr attribute="Variable" context="VarAssign" String="&varname;(?=\+?=|\[(?:$|[^]]))"/> |
| 576 |
<!-- handle keywords --> |
| 577 |
<keyword context="DispatchKeyword" String="keywords" lookAhead="1"/> |
| 578 |
<!-- handle commands that have variable names as argument --> |
| 579 |
<keyword attribute="Builtin" context="VarName" String="builtins_var" lookAhead="1"/> |
| 580 |
<!-- mark function definitions without function keyword --> |
| 581 |
<RegExpr attribute="Function" context="#stay" String="&funcname;[ &tab;]*\(\)"/> |
| 582 |
<!-- Special case for `: << '#BLOCK-COMMENT' form of "multiline" comments--> |
| 583 |
<RegExpr attribute="Normal Text" context="PreHereDocMLComment" String="^:[ &tab;]+<<[ &tab;]*'#([^']+)'$" lookAhead="1" column="0"/> |
| 584 |
<WordDetect attribute="Builtin" context="Coproc" String="coproc"/> |
| 585 |
<keyword attribute="Builtin" context="CommandArgs" String="builtins"/> |
| 586 |
<keyword attribute="Command" context="CommandArgs" String="unixcommands"/> |
| 587 |
|
| 588 |
<!-- handle redirection --> |
| 589 |
<AnyChar context="CommandMaybeRedirection" String="<>0123456789" lookAhead="1"/> |
| 590 |
|
| 591 |
<AnyChar attribute="Error" context="#stay" String=")}"/> |
| 592 |
|
| 593 |
<LineContinue attribute="Escape" context="#stay"/> |
| 594 |
|
| 595 |
<Detect2Chars attribute="Expression" context="#stay" char="!" char1=" "/> |
| 596 |
</context> |
| 597 |
<context attribute="Normal Text" lineEndContext="#pop" name="MaybeBracketExpression" fallthroughContext="#pop!Command"> |
| 598 |
<!-- start expression in double brackets --> |
| 599 |
<RegExpr attribute="Keyword" context="#pop!ExprDblBracket" String="\[\[(?=$|[ &tab;(])" beginRegion="expression"/> |
| 600 |
<!-- start expression in single brackets --> |
| 601 |
<RegExpr attribute="Builtin" context="#pop!ExprBracket" String="\[&eos;" beginRegion="expression"/> |
| 602 |
</context> |
| 603 |
<context attribute="Normal Text" lineEndContext="#pop" name="MaybeGroup"> |
| 604 |
<!-- start a group command with { --> |
| 605 |
<RegExpr attribute="Keyword" context="#pop!Group" String="\{&eos;" beginRegion="group"/> |
| 606 |
<DetectChar context="#pop!Command" char="{" lookAhead="1"/> |
| 607 |
</context> |
| 608 |
<context attribute="Normal Text" lineEndContext="#pop" name="CommandMaybeRedirection" fallthroughContext="#pop!Command"> |
| 609 |
<IncludeRules context="FindRedirection"/> |
| 610 |
</context> |
| 611 |
<context attribute="Normal Text" lineEndContext="#pop" name="Return" fallthroughContext="#pop"> |
| 612 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 613 |
<Int attribute="Decimal" context="#stay"/> |
| 614 |
</context> |
| 615 |
<!-- Comment consumes shell comments till EOL --> |
| 616 |
<context attribute="Comment" lineEndContext="#pop" name="Comment"> |
| 617 |
<DetectSpaces attribute="Comment"/> |
| 618 |
<IncludeRules context="##Comments"/> |
| 619 |
<DetectIdentifier attribute="Comment" context="#stay"/> |
| 620 |
</context> |
| 621 |
|
| 622 |
<!-- Group is called after a { is encountered --> |
| 623 |
<context attribute="Normal Text" lineEndContext="#stay" name="Group" fallthroughContext="Command"> |
| 624 |
<DetectChar context="MaybeGroupEnd" char="}" lookAhead="1"/> |
| 625 |
<IncludeRules context="Start"/> |
| 626 |
</context> |
| 627 |
<context attribute="Normal Text" lineEndContext="#pop" name="MaybeGroupEnd"> |
| 628 |
<!-- stop a group command with } --> |
| 629 |
<RegExpr attribute="Keyword" context="#pop#pop" String="\}&eoexpr;" endRegion="group"/> |
| 630 |
<DetectChar context="#pop!Command" char="}" lookAhead="1"/> |
| 631 |
</context> |
| 632 |
|
| 633 |
<context attribute="Normal Text" lineEndContext="#pop" name="Coproc" fallthroughContext="#pop"> |
| 634 |
<DetectSpaces attribute="Normal Text"/> |
| 635 |
<LineContinue attribute="Escape" context="#stay"/> |
| 636 |
<RegExpr context="CoprocName" String="(\$?&varname;|\$\{&varname;\}|'&varname;'|"(\$?&varname;|\$\{&varname;\}|[a-zA-Z0-9_])+")+(?=\s+\{($|\s))" lookAhead="1"/> |
| 637 |
</context> |
| 638 |
<context attribute="Normal Text" lineEndContext="#stay" name="CoprocName"> |
| 639 |
<DetectChar attribute="Keyword" context="#pop#pop!Group" char="{" beginRegion="group"/> |
| 640 |
<DetectSpaces attribute="Normal Text"/> |
| 641 |
<DetectIdentifier attribute="Normal Text"/> |
| 642 |
<IncludeRules context="FindWord"/> |
| 643 |
</context> |
| 644 |
|
| 645 |
<context attribute="Command" lineEndContext="#pop" name="Command" fallthroughContext="#pop"> |
| 646 |
<DetectSpaces attribute="Normal Text" context="#pop!CommandArgs"/> |
| 647 |
<DetectChar context="CommandVariables" char="$" lookAhead="1"/> |
| 648 |
<IncludeRules context="FindStrings"/> |
| 649 |
<DetectChar context="#pop" char="`" lookAhead="1"/> |
| 650 |
<RegExpr attribute="OtherCommand" context="CommandName" String="(?:[^&wordseps;&substseps;]++|\\.)+"/> |
| 651 |
<LineContinue attribute="Escape" context="#stay"/> |
| 652 |
<DetectChar context="CommandMaybeBraceExpansion" char="{" lookAhead="1"/> |
| 653 |
</context> |
| 654 |
<context attribute="Command" lineEndContext="#pop#pop" name="CommandVariables"> |
| 655 |
<IncludeRules context="DispatchVariables"/> |
| 656 |
<DetectChar attribute="OtherCommand" context="#pop" char="$"/> |
| 657 |
</context> |
| 658 |
<context attribute="Command" lineEndContext="#pop#pop" name="DispatchVariables"> |
| 659 |
<IncludeRules context="DispatchSubstVariables"/> |
| 660 |
<IncludeRules context="DispatchStringVariables"/> |
| 661 |
<IncludeRules context="DispatchVarnameVariables"/> |
| 662 |
</context> |
| 663 |
<context attribute="Command" lineEndContext="#pop#pop" name="DispatchSubstVariables"> |
| 664 |
<Detect2Chars attribute="Parameter Expansion" context="#pop!VarBraceStart" char="$" char1="{"/> |
| 665 |
<StringDetect context="#pop!ExprDblParenSubstOrSubstCommand" String="$((" lookAhead="1"/> |
| 666 |
<Detect2Chars attribute="Parameter Expansion" context="#pop!SubstCommand" char="$" char1="(" beginRegion="subshell"/> |
| 667 |
</context> |
| 668 |
<context attribute="Command" lineEndContext="#pop#pop" name="DispatchStringVariables"> |
| 669 |
<Detect2Chars attribute="String SingleQ" context="#pop!StringEsc" char="$" char1="'"/> |
| 670 |
<Detect2Chars attribute="String Transl." context="#pop!StringDQ" char="$" char1="""/> |
| 671 |
</context> |
| 672 |
<context attribute="Command" lineEndContext="#pop#pop" name="DispatchVarnameVariables"> |
| 673 |
<RegExpr attribute="Dollar Prefix" context="#pop!VarNamePrefixedWithDollar" String="\$(?=&varname;|[*@#?$!0-9-])"/> |
| 674 |
</context> |
| 675 |
<context attribute="Variable" lineEndContext="#pop" name="VarNamePrefixedWithDollar"> |
| 676 |
<DetectIdentifier attribute="Variable" context="#pop"/> |
| 677 |
<AnyChar attribute="Variable" context="#pop" String="*@#?$!0123456789-"/> |
| 678 |
</context> |
| 679 |
<context attribute="OtherCommand" lineEndContext="#pop#pop" name="CommandName"> |
| 680 |
<DetectSpaces attribute="Normal Text" context="#pop#pop!CommandArgs"/> |
| 681 |
<DetectIdentifier attribute="OtherCommand" context="#stay"/> |
| 682 |
<DetectChar context="CommandVariables" char="$" lookAhead="1"/> |
| 683 |
<IncludeRules context="FindStrings"/> |
| 684 |
<Detect2Chars attribute="Control" context="#pop#pop" char="&" char1="&"/> |
| 685 |
<Detect2Chars attribute="Control" context="#pop#pop" char="|" char1="|"/> |
| 686 |
<DetectChar attribute="Control" context="#pop#pop" char="|"/> |
| 687 |
<AnyChar context="#pop#pop" String=";)`" lookAhead="1"/> |
| 688 |
<AnyChar context="#pop#pop!CommandArgs" String="&<>" lookAhead="1"/> |
| 689 |
<!-- start expression in double parentheses --> |
| 690 |
<Detect2Chars attribute="Error" context="#pop#pop!ExprDblParen" char="(" char1="(" beginRegion="expression"/> |
| 691 |
<!-- start a subshell --> |
| 692 |
<DetectChar attribute="Error" context="#pop#pop!SubShell" char="(" beginRegion="subshell"/> |
| 693 |
<LineContinue attribute="Escape" context="#stay"/> |
| 694 |
<DetectChar context="#pop!CommandMaybeBraceExpansion" char="{" lookAhead="1"/> |
| 695 |
</context> |
| 696 |
<context attribute="Normal Text" lineEndContext="#pop" name="CommandMaybeBraceExpansion"> |
| 697 |
<IncludeRules context="DispatchBraceExpansion"/> |
| 698 |
<DetectChar attribute="OtherCommand" context="#pop" char="{"/> |
| 699 |
</context> |
| 700 |
|
| 701 |
<context attribute="Normal Text" lineEndContext="#stay" name="CommandBackq" fallthroughContext="Command"> |
| 702 |
<DetectChar attribute="Backquote" context="#pop!CommandArgs" char="`"/> |
| 703 |
<DetectChar attribute="Comment" context="CommentBackq" char="#"/> |
| 704 |
<IncludeRules context="Start"/> |
| 705 |
</context> |
| 706 |
<!-- CommentBackq consumes shell comments till EOL or a backquote --> |
| 707 |
<context attribute="Comment" lineEndContext="#pop" name="CommentBackq"> |
| 708 |
<DetectChar context="#pop" char="`" lookAhead="1"/> |
| 709 |
<IncludeRules context="Comment"/> |
| 710 |
</context> |
| 711 |
|
| 712 |
<!-- CommandArgs matches the items after a command --> |
| 713 |
<context attribute="Normal Text" lineEndContext="#pop" name="CommandArgs" fallthroughContext="CommandArg"> |
| 714 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 715 |
|
| 716 |
<!-- &> and &>> redirection --> |
| 717 |
<StringDetect attribute="Redirection" context="WordRedirection" String="&>>"/> |
| 718 |
<Detect2Chars attribute="Redirection" context="FdRedirection" char="&" char1=">"/> |
| 719 |
|
| 720 |
<!-- handle &, |, ;, ` --> |
| 721 |
<AnyChar context="#pop" String="&|;`" lookAhead="1"/> |
| 722 |
|
| 723 |
<!-- handle redirection --> |
| 724 |
<AnyChar context="CommandArgMaybeRedirection" String="<>0123456789" lookAhead="1"/> |
| 725 |
|
| 726 |
<DetectChar context="#pop" char=")" lookAhead="1"/> |
| 727 |
<DetectChar attribute="Error" context="#pop!SubShell" char="("/> |
| 728 |
</context> |
| 729 |
<context attribute="Normal Text" lineEndContext="#pop#pop" name="CommandArg" fallthroughContext="#pop!NormalOption"> |
| 730 |
<!-- In command arguments, do not allow comments after escaped characters. |
| 731 |
This avoids highlighting comments within paths or other text. Ex: pathtext\ #no\ comment --> |
| 732 |
<DetectChar context="#pop#pop" char="#" lookAhead="1"/> |
| 733 |
<Detect2Chars attribute="Option" context="#pop!LongOption" char="-" char1="-"/> |
| 734 |
<DetectChar attribute="Option" context="#pop!ShortOption" char="-"/> |
| 735 |
</context> |
| 736 |
<context attribute="Normal Text" lineEndContext="#pop" name="CommandArgMaybeRedirection" fallthroughContext="#pop!NormalOption"> |
| 737 |
<IncludeRules context="FindRedirection"/> |
| 738 |
</context> |
| 739 |
|
| 740 |
<context attribute="Option" lineEndContext="#pop" name="ShortOption" fallthroughContext="#pop"> |
| 741 |
<DetectChar attribute="Path" context="PathThenPop" char="/"/> |
| 742 |
<IncludeRules context="LongOption"/> |
| 743 |
</context> |
| 744 |
<context attribute="Option" lineEndContext="#pop" name="LongOption" fallthroughContext="#pop"> |
| 745 |
<AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/> |
| 746 |
<DetectChar attribute="Operator" context="#pop!NormalOption" char="="/> |
| 747 |
<IncludeRules context="FindWord"/> |
| 748 |
<IncludeRules context="FindGlobAndPop"/> |
| 749 |
<DetectChar context="OptionMaybeBraceExpansion" char="{" lookAhead="1"/> |
| 750 |
<DetectChar context="LongOptionMaybeGlobAny" char="[" lookAhead="1"/> |
| 751 |
<RegExpr attribute="Option" context="#stay" String="&opt;"/> |
| 752 |
</context> |
| 753 |
<context attribute="Option" lineEndContext="#pop#pop" name="LongOptionMaybeGlobAny" fallthroughContext="#pop"> |
| 754 |
<IncludeRules context="FindGlobAny"/> |
| 755 |
<DetectChar attribute="Option" context="#pop" char="["/> |
| 756 |
</context> |
| 757 |
<context attribute="Normal Text" lineEndContext="#pop" name="NormalOption" fallthroughContext="#pop"> |
| 758 |
<AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/> |
| 759 |
<IncludeRules context="FindWord"/> |
| 760 |
<DetectChar context="NormalMaybeBraceExpansion" char="{" lookAhead="1"/> |
| 761 |
<IncludeRules context="FindNormalText"/> |
| 762 |
</context> |
| 763 |
<context attribute="Normal Text" lineEndContext="#stay" name="FindNormalText"> |
| 764 |
<IncludeRules context="FindGlobAndPop"/> |
| 765 |
<RegExpr attribute="Path" context="PathThenPop" String="&pathpart;"/> |
| 766 |
<DetectChar context="FindPathThenPopMaybeGlobAny" char="[" lookAhead="1"/> |
| 767 |
<RegExpr attribute="Normal Text" context="#stay" String="[^&wordseps;&substseps;\[]+"/> |
| 768 |
</context> |
| 769 |
<context attribute="Normal Text" lineEndContext="#pop" name="OptionMaybeBraceExpansion"> |
| 770 |
<IncludeRules context="DispatchBraceExpansion"/> |
| 771 |
<DetectChar attribute="Option" context="#pop" char="{"/> |
| 772 |
</context> |
| 773 |
<context attribute="Normal Text" lineEndContext="#pop" name="NormalMaybeBraceExpansion"> |
| 774 |
<IncludeRules context="DispatchBraceExpansion"/> |
| 775 |
<DetectChar attribute="Normal Text" context="#pop" char="{"/> |
| 776 |
</context> |
| 777 |
|
| 778 |
<context attribute="Normal Text" lineEndContext="#pop" name="AssumeEscape"> |
| 779 |
<LineContinue attribute="Escape" context="#pop"/> |
| 780 |
<RegExpr attribute="Escape" context="#pop" String="\\."/> |
| 781 |
</context> |
| 782 |
|
| 783 |
<!-- ====== The following rulessets are meant to be included ======== --> |
| 784 |
|
| 785 |
<!-- FindRedirection consumes shell redirection --> |
| 786 |
<context attribute="Normal Text" lineEndContext="#pop" name="FindRedirection"> |
| 787 |
<RegExpr attribute="File Descriptor" context="#pop!AssumeRedirection" String="[0-9]++(?=[<>])"/> |
| 788 |
<IncludeRules context="AssumeRedirection"/> |
| 789 |
</context> |
| 790 |
|
| 791 |
<!-- DispatchBraceExpansion consumes brace expansions --> |
| 792 |
<context attribute="Normal Text" lineEndContext="#pop" name="DispatchBraceExpansion"> |
| 793 |
<!-- Only highlighting closed braces. The "BraceExpansion" context corrects |
| 794 |
the closure of braces and allows recursive braces (bug #387915). --> |
| 795 |
<RegExpr context="#pop!BraceExpansion" String="&braceexpansion;" lookAhead="1"/> |
| 796 |
<RegExpr attribute="Escape" context="#pop!SequenceExpression" String="{(?=([-+]?[0-9]+\.\.[-+]?[0-9]+|[a-zA-Z]\.\.[a-zA-Z])(\.\.[-+]?[0-9]+)?\})"/> |
| 797 |
</context> |
| 798 |
|
| 799 |
<!-- FindPathThenPopMaybeGlobAny consumes path --> |
| 800 |
<context attribute="Normal Text" lineEndContext="#pop#pop" name="FindPathThenPopMaybeGlobAny" fallthroughContext="#pop!PathThenPop"> |
| 801 |
<IncludeRules context="FindGlobAny"/> |
| 802 |
<DetectChar attribute="Normal Text" context="#pop" char="["/> |
| 803 |
</context> |
| 804 |
<context attribute="Path" lineEndContext="#pop" name="FindGlobAndPop"> |
| 805 |
<Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="?" char1="("/> |
| 806 |
<Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="*" char1="("/> |
| 807 |
<AnyChar attribute="Glob" context="PathThenPop" String="?*"/> |
| 808 |
<Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="+" char1="("/> |
| 809 |
<Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="@" char1="("/> |
| 810 |
<Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="!" char1="("/> |
| 811 |
</context> |
| 812 |
<context attribute="Path" lineEndContext="#stay" name="ExtGlobAndPop"> |
| 813 |
<DetectChar attribute="Glob" context="#pop!PathThenPop" char=")"/> |
| 814 |
<IncludeRules context="FindWord"/> |
| 815 |
<IncludeRules context="IncExtGlob"/> |
| 816 |
</context> |
| 817 |
<context attribute="Path" lineEndContext="#stay" name="FindExtGlob"> |
| 818 |
<Detect2Chars attribute="Glob" context="RecursiveExtGlob" char="?" char1="("/> |
| 819 |
<Detect2Chars attribute="Glob" context="RecursiveExtGlob" char="*" char1="("/> |
| 820 |
<Detect2Chars attribute="Glob" context="RecursiveExtGlob" char="+" char1="("/> |
| 821 |
<Detect2Chars attribute="Glob" context="RecursiveExtGlob" char="@" char1="("/> |
| 822 |
<Detect2Chars attribute="Glob" context="RecursiveExtGlob" char="!" char1="("/> |
| 823 |
<AnyChar attribute="Glob" context="#stay" String="|?*"/> |
| 824 |
</context> |
| 825 |
<context attribute="Path" lineEndContext="#stay" name="RecursiveExtGlob"> |
| 826 |
<DetectChar attribute="Glob" context="#pop" char=")"/> |
| 827 |
<IncludeRules context="FindWord"/> |
| 828 |
<IncludeRules context="IncExtGlob"/> |
| 829 |
<IncludeRules context="PathThenPopMaybeGlobAny"/> |
| 830 |
</context> |
| 831 |
<context attribute="Path" lineEndContext="#stay" name="IncExtGlob"> |
| 832 |
<DetectIdentifier attribute="Path"/> |
| 833 |
<IncludeRules context="FindExtGlob"/> |
| 834 |
<DetectChar context="PathMaybeBraceExpansion" char="{" lookAhead="1"/> |
| 835 |
</context> |
| 836 |
<context attribute="Path" lineEndContext="#pop#pop" name="PathThenPop"> |
| 837 |
<AnyChar context="#pop#pop" String="&wordseps;`" lookAhead="1"/> |
| 838 |
<IncludeRules context="FindWord"/> |
| 839 |
<IncludeRules context="FindExtGlob"/> |
| 840 |
<DetectChar context="PathMaybeBraceExpansion" char="{" lookAhead="1"/> |
| 841 |
<DetectChar context="PathThenPopMaybeGlobAny" char="[" lookAhead="1"/> |
| 842 |
<RegExpr attribute="Path" context="#stay" String="&path;"/> |
| 843 |
</context> |
| 844 |
<context attribute="Path" lineEndContext="#pop#pop" name="PathThenPopMaybeGlobAny" fallthroughContext="#pop"> |
| 845 |
<IncludeRules context="FindGlobAny"/> |
| 846 |
<DetectChar attribute="Path" context="#pop" char="["/> |
| 847 |
</context> |
| 848 |
<context attribute="Path" lineEndContext="#pop" name="PathMaybeBraceExpansion" fallthroughContext="#pop"> |
| 849 |
<IncludeRules context="DispatchBraceExpansion"/> |
| 850 |
<DetectChar attribute="Path" context="#pop" char="{"/> |
| 851 |
</context> |
| 852 |
|
| 853 |
<context attribute="Glob" lineEndContext="#stay" name="FindGlobAny"> |
| 854 |
<RegExpr attribute="Glob" context="GlobAnyFlag" String="\[(?=&next_is_globany;)"/> |
| 855 |
</context> |
| 856 |
<context attribute="Pattern" lineEndContext="#pop" name="GlobAnyFlag" fallthroughContext="#pop!GlobAny"> |
| 857 |
<DetectChar attribute="Glob" context="#pop!GlobAny" char="^"/> |
| 858 |
</context> |
| 859 |
<context attribute="Pattern" lineEndContext="#pop" name="GlobAny"> |
| 860 |
<DetectIdentifier attribute="Pattern"/> |
| 861 |
<DetectChar context="AssumeEscape" char="\" lookAhead="1"/> |
| 862 |
<DetectChar attribute="Glob" context="#stay" char="-"/> |
| 863 |
<IncludeRules context="FindStrings"/> |
| 864 |
<DetectChar attribute="Glob" context="#pop" char="]"/> |
| 865 |
<Detect2Chars attribute="Glob" context="GlobClass" char="[" char1=":"/> |
| 866 |
</context> |
| 867 |
<context attribute="Glob" lineEndContext="#pop#pop" name="GlobClass"> |
| 868 |
<DetectIdentifier attribute="Pattern"/> |
| 869 |
<Detect2Chars attribute="Glob" context="#pop" char=":" char1="]"/> |
| 870 |
<DetectChar attribute="Error" context="#pop" char="]"/> |
| 871 |
</context> |
| 872 |
|
| 873 |
<!-- FindPathThenPopInAlternateValue consumes path in ${xx:here}--> |
| 874 |
<context attribute="Normal Text" lineEndContext="#pop" name="FindPathThenPopInAlternateValue"> |
| 875 |
<Detect2Chars context="#pop!PathThenPopInAlternateValue" char="?" char1="(" lookAhead="1"/> |
| 876 |
<Detect2Chars context="#pop!PathThenPopInAlternateValue" char="*" char1="(" lookAhead="1"/> |
| 877 |
<Detect2Chars context="#pop!PathThenPopInAlternateValue" char="+" char1="(" lookAhead="1"/> |
| 878 |
<Detect2Chars context="#pop!PathThenPopInAlternateValue" char="@" char1="(" lookAhead="1"/> |
| 879 |
<Detect2Chars context="#pop!PathThenPopInAlternateValue" char="!" char1="(" lookAhead="1"/> |
| 880 |
<AnyChar attribute="Glob" context="#pop!PathThenPopInAlternateValue" String="?*"/> |
| 881 |
<RegExpr attribute="Path" context="#pop!PathThenPopInAlternateValue" String="&pathpart_alt;"/> |
| 882 |
</context> |
| 883 |
<context attribute="Path" lineEndContext="#pop#pop" name="PathThenPopInAlternateValue"> |
| 884 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 885 |
<IncludeRules context="FindWord"/> |
| 886 |
<Detect2Chars attribute="Glob" context="ExtGlobAndPopInAlternateValue" char="?" char1="("/> |
| 887 |
<Detect2Chars attribute="Glob" context="ExtGlobAndPopInAlternateValue" char="*" char1="("/> |
| 888 |
<Detect2Chars attribute="Glob" context="ExtGlobAndPopInAlternateValue" char="+" char1="("/> |
| 889 |
<Detect2Chars attribute="Glob" context="ExtGlobAndPopInAlternateValue" char="@" char1="("/> |
| 890 |
<Detect2Chars attribute="Glob" context="ExtGlobAndPopInAlternateValue" char="!" char1="("/> |
| 891 |
<AnyChar attribute="Glob" context="#stay" String="?*"/> |
| 892 |
<RegExpr attribute="Path" context="#stay" String="&path_alt;"/> |
| 893 |
</context> |
| 894 |
<context attribute="Path" lineEndContext="#stay" name="ExtGlobAndPopInAlternateValue"> |
| 895 |
<DetectChar attribute="Glob" context="#pop" char=")"/> |
| 896 |
<DetectChar attribute="Error" context="#pop#pop" char="}"/> |
| 897 |
<IncludeRules context="FindWord"/> |
| 898 |
<IncludeRules context="FindExtGlobInAlternateValue"/> |
| 899 |
</context> |
| 900 |
<context attribute="Path" lineEndContext="#stay" name="FindExtGlobInAlternateValue"> |
| 901 |
<DetectIdentifier attribute="Path"/> |
| 902 |
<Detect2Chars attribute="Glob" context="RecursiveExtGlobInAlternateValue" char="?" char1="("/> |
| 903 |
<Detect2Chars attribute="Glob" context="RecursiveExtGlobInAlternateValue" char="*" char1="("/> |
| 904 |
<Detect2Chars attribute="Glob" context="RecursiveExtGlobInAlternateValue" char="+" char1="("/> |
| 905 |
<Detect2Chars attribute="Glob" context="RecursiveExtGlobInAlternateValue" char="@" char1="("/> |
| 906 |
<Detect2Chars attribute="Glob" context="RecursiveExtGlobInAlternateValue" char="!" char1="("/> |
| 907 |
<AnyChar attribute="Glob" context="#stay" String="|?*"/> |
| 908 |
</context> |
| 909 |
<context attribute="Path" lineEndContext="#stay" name="RecursiveExtGlobInAlternateValue"> |
| 910 |
<DetectChar attribute="Glob" context="#pop" char=")"/> |
| 911 |
<DetectChar context="#pop" char="}" lookAhead="1"/> |
| 912 |
<IncludeRules context="FindWord"/> |
| 913 |
<IncludeRules context="FindExtGlobInAlternateValue"/> |
| 914 |
</context> |
| 915 |
|
| 916 |
<context attribute="Pattern" lineEndContext="#stay" name="FindPattern"> |
| 917 |
<Detect2Chars attribute="Glob" context="ExtPattern" char="?" char1="("/> |
| 918 |
<Detect2Chars attribute="Glob" context="ExtPattern" char="*" char1="("/> |
| 919 |
<Detect2Chars attribute="Glob" context="ExtPattern" char="+" char1="("/> |
| 920 |
<Detect2Chars attribute="Glob" context="ExtPattern" char="@" char1="("/> |
| 921 |
<Detect2Chars attribute="Glob" context="ExtPattern" char="!" char1="("/> |
| 922 |
<AnyChar attribute="Glob" context="#stay" String="?*"/> |
| 923 |
</context> |
| 924 |
<context attribute="Pattern" lineEndContext="#stay" name="ExtPattern"> |
| 925 |
<DetectIdentifier attribute="Pattern"/> |
| 926 |
<DetectChar attribute="Glob" context="#stay" char="|"/> |
| 927 |
<IncludeRules context="FindWord"/> |
| 928 |
<DetectChar attribute="Glob" context="#pop" char=")"/> |
| 929 |
<IncludeRules context="FindPattern"/> |
| 930 |
</context> |
| 931 |
|
| 932 |
<context attribute="Normal Text" lineEndContext="#pop" name="VarAssign" fallthroughContext="#pop"> |
| 933 |
<DetectChar attribute="Parameter Expansion Operator" context="Subscript" char="["/> |
| 934 |
<DetectChar attribute="Operator" context="#pop!Assign" char="="/> |
| 935 |
<Detect2Chars attribute="Operator" context="#pop!Assign" char="+" char1="="/> |
| 936 |
</context> |
| 937 |
|
| 938 |
<context attribute="Normal Text" lineEndContext="#pop" name="DispatchKeyword"> |
| 939 |
<!-- match do and if blocks --> |
| 940 |
<Detect2Chars attribute="Control Flow" context="#pop!NotCond" char="i" char1="f" beginRegion="if"/> |
| 941 |
<Detect2Chars attribute="Control Flow" context="#pop" char="f" char1="i" endRegion="if"/> |
| 942 |
<StringDetect attribute="Control Flow" context="#pop" String="done" endRegion="do"/> |
| 943 |
<Detect2Chars attribute="Control Flow" context="#pop" char="d" char1="o" beginRegion="do"/> |
| 944 |
<!-- handle while/until as a special case --> |
| 945 |
<StringDetect attribute="Control Flow" context="#pop!NotCond" String="while"/> |
| 946 |
<StringDetect attribute="Control Flow" context="#pop!NotCond" String="until"/> |
| 947 |
<!-- handle for as a special case --> |
| 948 |
<StringDetect attribute="Control Flow" context="#pop!For" String="for"/> |
| 949 |
<!-- handle select as a special case --> |
| 950 |
<StringDetect attribute="Control Flow" context="#pop!For" String="select"/> |
| 951 |
<!-- handle case as a special case --> |
| 952 |
<StringDetect attribute="Control Flow" context="#pop!Case" String="case" beginRegion="case"/> |
| 953 |
<!-- handle functions with function keyword before keywords --> |
| 954 |
<StringDetect attribute="Keyword" context="#pop!FunctionDef" String="function"/> |
| 955 |
<StringDetect attribute="Control Flow" context="#pop!Return" String="return"/> |
| 956 |
<!-- not a keyword in this context --> |
| 957 |
<Detect2Chars attribute="Error" context="#pop" char="i" char1="n"/> |
| 958 |
<StringDetect attribute="Error" context="#pop" String="esac"/> |
| 959 |
<!-- handle keywords --> |
| 960 |
<DetectIdentifier attribute="Control Flow" context="#pop"/> |
| 961 |
</context> |
| 962 |
|
| 963 |
<!-- if ! ..., while ! ... and until ! ... --> |
| 964 |
<context attribute="Normal Text" lineEndContext="#pop" name="NotCond" fallthroughContext="#pop"> |
| 965 |
<DetectSpaces attribute="Normal Text" context="#pop!NotCond2"/> |
| 966 |
</context> |
| 967 |
<context attribute="Normal Text" lineEndContext="#pop" name="NotCond2" fallthroughContext="#pop"> |
| 968 |
<Detect2Chars attribute="Expression" context="#pop" char="!" char1="&tab;"/> |
| 969 |
<Detect2Chars attribute="Expression" context="#pop" char="!" char1=" "/> |
| 970 |
<LineContinue attribute="Expression" context="#pop" char="!"/> |
| 971 |
</context> |
| 972 |
|
| 973 |
<context attribute="Normal Text" lineEndContext="#pop" name="For" fallthroughContext="#pop"> |
| 974 |
<LineContinue attribute="Escape" context="#stay"/> |
| 975 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 976 |
<DetectIdentifier attribute="Normal Text" context="#pop!ForIn"/> |
| 977 |
<Detect2Chars attribute="Keyword" context="#pop!ForArithmeticExpr" char="(" char1="("/> |
| 978 |
</context> |
| 979 |
<context attribute="Normal Text" lineEndContext="#pop" name="ForIn" fallthroughContext="#pop"> |
| 980 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 981 |
<DetectChar attribute="Control" context="#pop" char=";"/> |
| 982 |
<WordDetect attribute="Keyword" context="#pop!CommandArgs" String="in"/> |
| 983 |
</context> |
| 984 |
<context attribute="Normal Text" lineEndContext="#pop" name="ForArithmeticExpr"> |
| 985 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 986 |
<DetectChar attribute="Control" context="#stay" char=";"/> |
| 987 |
<Detect2Chars attribute="Keyword" context="#pop" char=")" char1=")"/> |
| 988 |
<IncludeRules context="FindExprDblParen"/> |
| 989 |
</context> |
| 990 |
|
| 991 |
<context attribute="Normal Text" lineEndContext="#pop" name="AssumeRedirection"> |
| 992 |
<!-- handle output redirection --> |
| 993 |
<Detect2Chars attribute="Redirection" context="#pop!WordRedirection" char=">" char1=">"/> |
| 994 |
<Detect2Chars attribute="Redirection" context="#pop!WordRedirection" char=">" char1="|"/> |
| 995 |
<Detect2Chars attribute="Redirection" context="#pop!FdRedirection" char=">" char1="&"/> |
| 996 |
<Detect2Chars attribute="Redirection" context="#pop!ProcessSubst" char=">" char1="("/> |
| 997 |
<DetectChar attribute="Redirection" context="#pop!WordRedirection" char=">"/> |
| 998 |
<StringDetect attribute="Redirection" context="#pop!StringRedirection" String="<<<"/> |
| 999 |
<!-- handle here document --> |
| 1000 |
<Detect2Chars context="#pop!HereDoc" char="<" char1="<" lookAhead="1"/> |
| 1001 |
<!-- handle input redirection --> |
| 1002 |
<Detect2Chars attribute="Redirection" context="#pop!FdRedirection" char="<" char1="&"/> |
| 1003 |
<Detect2Chars attribute="Redirection" context="#pop!WordRedirection" char="<" char1=">"/> |
| 1004 |
<Detect2Chars attribute="Redirection" context="#pop!ProcessSubst" char="<" char1="("/> |
| 1005 |
<DetectChar attribute="Redirection" context="#pop!WordRedirection" char="<"/> |
| 1006 |
</context> |
| 1007 |
<context attribute="Normal Text" lineEndContext="#pop" name="FdRedirection" fallthroughContext="#pop!FdRedirection2"> |
| 1008 |
<DetectSpaces attribute="Normal Text" context="#pop!FdRedirection2"/> |
| 1009 |
</context> |
| 1010 |
<context attribute="Normal Text" lineEndContext="#pop" name="FdRedirection2" fallthroughContext="#pop!WordRedirection2"> |
| 1011 |
<RegExpr attribute="File Descriptor" context="#pop!CloseFile" String="[0-9]+(?=-?&eoexpr;)"/> |
| 1012 |
</context> |
| 1013 |
<context attribute="Normal Text" lineEndContext="#pop" name="WordRedirection" fallthroughContext="#pop!WordRedirection2"> |
| 1014 |
<DetectSpaces attribute="Normal Text" context="#pop!WordRedirection2"/> |
| 1015 |
</context> |
| 1016 |
<context attribute="Normal Text" lineEndContext="#pop" name="WordRedirection2" fallthroughContext="#pop"> |
| 1017 |
<AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/> |
| 1018 |
<IncludeRules context="FindWord"/> |
| 1019 |
<RegExpr attribute="Path" context="PathThenPop" String="&path;"/> |
| 1020 |
</context> |
| 1021 |
<context attribute="Normal Text" lineEndContext="#pop" name="StringRedirection" fallthroughContext="#pop!StringRedirection2"> |
| 1022 |
<DetectSpaces attribute="Normal Text" context="#pop!StringRedirection2"/> |
| 1023 |
</context> |
| 1024 |
<context attribute="Normal Text" lineEndContext="#pop" name="StringRedirection2"> |
| 1025 |
<AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/> |
| 1026 |
<IncludeRules context="FindWord"/> |
| 1027 |
<DetectIdentifier attribute="Normal Text"/> |
| 1028 |
</context> |
| 1029 |
<context attribute="Normal Text" lineEndContext="#pop" name="CloseFile" fallthroughContext="#pop"> |
| 1030 |
<DetectChar attribute="Keyword" context="#pop" char="-"/> |
| 1031 |
</context> |
| 1032 |
|
| 1033 |
<!-- HereDoc consumes Here-documents. It is called at the beginning of the "<<" construct. --> |
| 1034 |
<context attribute="Normal Text" lineEndContext="#stay" name="HereDoc"> |
| 1035 |
<RegExpr attribute="Redirection" context="HereDocMLComment" String="^[ &tab;]*<<[ &tab;]*'#([^']+)'$" column="0"/> |
| 1036 |
<RegExpr attribute="Redirection" context="HereDocIQ" String="<<-[ &tab;]*&heredocq;(?=[ &tab;]*$)"/> |
| 1037 |
<RegExpr attribute="Redirection" context="HereDocINQ" String="<<-[ &tab;]*([^&wordseps;]+)(?=[ &tab;]*$)"/> |
| 1038 |
<RegExpr attribute="Redirection" context="HereDocQ" String="<<[ &tab;]*&heredocq;(?=[ &tab;]*$)"/> |
| 1039 |
<RegExpr attribute="Redirection" context="HereDocNQ" String="<<[ &tab;]*([^&wordseps;]+)(?=[ &tab;]*$)"/> |
| 1040 |
|
| 1041 |
<RegExpr context="HereDocIQCmd" String="(<<-[ &tab;]*&heredocq;)" lookAhead="1"/> |
| 1042 |
<RegExpr context="HereDocINQCmd" String="(<<-[ &tab;]*([^&wordseps;]+))" lookAhead="1"/> |
| 1043 |
<RegExpr context="HereDocQCmd" String="(<<[ &tab;]*&heredocq;)" lookAhead="1"/> |
| 1044 |
<RegExpr context="HereDocNQCmd" String="(<<[ &tab;]*([^&wordseps;]+))" lookAhead="1"/> |
| 1045 |
|
| 1046 |
<Detect2Chars attribute="Redirection" context="#pop" char="<" char1="<"/><!-- always met --> |
| 1047 |
</context> |
| 1048 |
|
| 1049 |
<context attribute="Normal Text" lineEndContext="#pop" name="HereDocRemainder" fallthroughContext="Command"> |
| 1050 |
<IncludeRules context="Start"/> |
| 1051 |
</context> |
| 1052 |
|
| 1053 |
<!-- Highlight the builtin `:` (true) and the followed redirection, then fall into `HereDocMLComment` --> |
| 1054 |
<context attribute="Comment" lineEndContext="#stay" name="PreHereDocMLComment"> |
| 1055 |
<DetectChar attribute="Builtin" context="#stay" char=":" column="0"/> |
| 1056 |
<RegExpr attribute="Redirection" context="HereDocMLComment" String="<<[ &tab;]*'#([^']+)'$"/> |
| 1057 |
</context> |
| 1058 |
|
| 1059 |
<context attribute="Comment" lineEndContext="#stay" name="HereDocMLComment" dynamic="true" fallthroughContext="Comment"> |
| 1060 |
<RegExpr attribute="Redirection" context="#pop#pop" String="^#%1$" column="0" dynamic="true"/> |
| 1061 |
<RegExpr attribute="Region Marker" context="RST Documentation" String="^#?\[(=*)\[\.rst:" column="0" beginRegion="RSTDocumentation" /> |
| 1062 |
<IncludeRules context="Comment"/> |
| 1063 |
</context> |
| 1064 |
|
| 1065 |
<context attribute="Comment" lineEndContext="#stay" name="RST Documentation" dynamic="true"> |
| 1066 |
<RegExpr attribute="Redirection" context="#pop#pop#pop" String="^#BLOCK-COMMENT$" column="0"/> |
| 1067 |
<RegExpr attribute="Region Marker" context="#pop" String="^#?\]%1\]" dynamic="true" column="0" endRegion="RSTDocumentation" /> |
| 1068 |
<IncludeRules context="##reStructuredText" /> |
| 1069 |
</context> |
| 1070 |
|
| 1071 |
<context attribute="Here Doc" lineEndContext="#stay" name="HereDocQ" dynamic="true" fallthroughContext="HereDocText"> |
| 1072 |
<RegExpr attribute="Redirection" context="#pop#pop" String="^%1$" dynamic="true" column="0"/> |
| 1073 |
</context> |
| 1074 |
|
| 1075 |
<context attribute="Here Doc" lineEndContext="#stay" name="HereDocNQ" dynamic="true" fallthroughContext="HereDocSubstitutions"> |
| 1076 |
<RegExpr attribute="Redirection" context="#pop#pop" String="^%1$" dynamic="true" column="0"/> |
| 1077 |
</context> |
| 1078 |
|
| 1079 |
<context attribute="Here Doc" lineEndContext="#stay" name="HereDocIQ" dynamic="true" fallthroughContext="HereDocText"> |
| 1080 |
<RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%1$" dynamic="true" column="0"/> |
| 1081 |
</context> |
| 1082 |
|
| 1083 |
<context attribute="Here Doc" lineEndContext="#stay" name="HereDocINQ" dynamic="true" fallthroughContext="HereDocSubstitutions"> |
| 1084 |
<RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%1$" dynamic="true" column="0"/> |
| 1085 |
</context> |
| 1086 |
|
| 1087 |
<context attribute="Here Doc" lineEndContext="#stay" name="HereDocQCmd" dynamic="true" fallthroughContext="HereDocText"> |
| 1088 |
<StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true"/> |
| 1089 |
<RegExpr attribute="Redirection" context="#pop#pop" String="^%2$" dynamic="true" column="0"/> |
| 1090 |
</context> |
| 1091 |
|
| 1092 |
<context attribute="Here Doc" lineEndContext="#stay" name="HereDocNQCmd" dynamic="true" fallthroughContext="HereDocSubstitutions"> |
| 1093 |
<StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true"/> |
| 1094 |
<RegExpr attribute="Redirection" context="#pop#pop" String="^%2$" dynamic="true" column="0"/> |
| 1095 |
</context> |
| 1096 |
|
| 1097 |
<context attribute="Here Doc" lineEndContext="#stay" name="HereDocIQCmd" dynamic="true" fallthroughContext="HereDocText"> |
| 1098 |
<StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true"/> |
| 1099 |
<RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%2$" dynamic="true" column="0"/> |
| 1100 |
</context> |
| 1101 |
|
| 1102 |
<context attribute="Here Doc" lineEndContext="#stay" name="HereDocINQCmd" dynamic="true" fallthroughContext="HereDocSubstitutions"> |
| 1103 |
<StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true"/> |
| 1104 |
<RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%2$" dynamic="true" column="0"/> |
| 1105 |
</context> |
| 1106 |
|
| 1107 |
<context attribute="Here Doc" lineEndContext="#pop" name="HereDocText"> |
| 1108 |
</context> |
| 1109 |
|
| 1110 |
<context attribute="Here Doc" lineEndContext="#pop" name="HereDocSubstitutions"> |
| 1111 |
<DetectSpaces attribute="Here Doc"/> |
| 1112 |
<DetectIdentifier attribute="Here Doc"/> |
| 1113 |
<DetectChar context="HereDocVariables" char="$" lookAhead="1"/> |
| 1114 |
<DetectChar attribute="Backquote" context="CommandBackq" char="`"/> |
| 1115 |
<DetectChar context="AssumeEscape" char="\" lookAhead="1"/> |
| 1116 |
</context> |
| 1117 |
<context attribute="Here Doc" lineEndContext="#pop" name="HereDocVariables"> |
| 1118 |
<IncludeRules context="DispatchSubstVariables"/> |
| 1119 |
<IncludeRules context="DispatchVarnameVariables"/> |
| 1120 |
<DetectChar attribute="Here Doc" context="#pop" char="$"/> |
| 1121 |
</context> |
| 1122 |
|
| 1123 |
<!-- VarName consumes spare variable names and assignments --> |
| 1124 |
<context attribute="Normal Text" lineEndContext="#pop" name="VarName"> |
| 1125 |
<StringDetect attribute="Builtin" context="#pop!BuiltinGetopts" String="getopts"/> |
| 1126 |
<StringDetect attribute="Builtin" context="#pop!BuiltinLet" String="let"/> |
| 1127 |
<DetectIdentifier attribute="Builtin" context="#pop!VarNameArgs"/> |
| 1128 |
<AnyChar attribute="Builtin" context="#pop!VarNameArgs" String=".:"/> |
| 1129 |
</context> |
| 1130 |
<context attribute="Normal Text" lineEndContext="#pop" name="VarNameArgs" fallthroughContext="#pop!CommandArgs"> |
| 1131 |
<DetectSpaces attribute="Normal Text" context="VarNameArg"/> |
| 1132 |
<LineContinue attribute="Escape" context="#stay"/> |
| 1133 |
</context> |
| 1134 |
<context attribute="Normal Text" lineEndContext="#pop#pop" name="VarNameArg" fallthroughContext="#pop!VarNameArg2"> |
| 1135 |
<!-- In command arguments, do not allow comments after escaped characters. |
| 1136 |
This avoids highlighting comments within paths or other text. Ex: pathtext\ #no\ comment --> |
| 1137 |
<DetectChar context="#pop#pop" char="#" lookAhead="1"/> |
| 1138 |
<DetectChar attribute="Option" context="#pop!ShortOption" char="-"/> |
| 1139 |
</context> |
| 1140 |
<context attribute="Normal Text" lineEndContext="#pop" name="VarNameArg2" fallthroughContext="#pop!NormalOption"> |
| 1141 |
<DetectChar attribute="Variable" context="Subscript" char="["/> |
| 1142 |
<DetectChar attribute="Operator" context="Assign" char="="/> |
| 1143 |
<DetectChar attribute="Variable" context="AssignArray" char="("/> |
| 1144 |
<DetectIdentifier attribute="Variable" context="#stay"/> |
| 1145 |
</context> |
| 1146 |
<context attribute="Normal Text" lineEndContext="#pop" name="BuiltinGetopts" fallthroughContext="#pop!CommandArgs"> |
| 1147 |
<DetectSpaces attribute="Normal Text" context="#pop!BuiltinGetoptsOpt"/> |
| 1148 |
<LineContinue attribute="Escape" context="#stay"/> |
| 1149 |
</context> |
| 1150 |
<context attribute="Normal Text" lineEndContext="#pop#pop" name="BuiltinGetoptsOpt" fallthroughContext="#pop!BuiltinGetoptsOpt2"> |
| 1151 |
<DetectChar context="#pop#pop" char="#" lookAhead="1"/> |
| 1152 |
</context> |
| 1153 |
<context attribute="Normal Text" lineEndContext="#pop" name="BuiltinGetoptsOpt2" fallthroughContext="#pop!NormalOption"> |
| 1154 |
<DetectChar attribute="Operator" context="#stay" char=":"/> |
| 1155 |
<DetectIdentifier attribute="Normal Text" context="#stay" /> |
| 1156 |
<DetectSpaces attribute="Normal Text" context="#pop!BuiltinGetoptsVar"/> |
| 1157 |
<AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/> |
| 1158 |
<IncludeRules context="FindWord"/> |
| 1159 |
<DetectChar context="NormalMaybeBraceExpansion" char="{" lookAhead="1"/> |
| 1160 |
<AnyChar attribute="Normal Text" context="#stay" String="/%.0123456789"/> |
| 1161 |
</context> |
| 1162 |
<context attribute="Normal Text" lineEndContext="#pop" name="BuiltinGetoptsVar" fallthroughContext="#pop!CommandArgs"> |
| 1163 |
<DetectIdentifier attribute="Variable" context="#pop!CommandArgs"/> |
| 1164 |
</context> |
| 1165 |
<context attribute="Normal Text" lineEndContext="#pop" name="BuiltinLet" fallthroughContext="#pop!CommandArgs"> |
| 1166 |
<DetectSpaces attribute="Normal Text" context="#pop!BuiltinLetArgs"/> |
| 1167 |
<LineContinue attribute="Escape" context="#stay"/> |
| 1168 |
</context> |
| 1169 |
<context attribute="Normal Text" lineEndContext="#pop" name="BuiltinLetArgs" fallthroughContext="BuiltinLetArg"> |
| 1170 |
<AnyChar context="BuiltinLetArgsNumber" String="0123456789" lookAhead="1"/> |
| 1171 |
<IncludeRules context="CommandArgs"/> |
| 1172 |
</context> |
| 1173 |
<context attribute="Normal Text" lineEndContext="#pop" name="BuiltinLetArgsNumber" fallthroughContext="#pop!BuiltinLetArg"> |
| 1174 |
<IncludeRules context="FindRedirection"/> |
| 1175 |
</context> |
| 1176 |
<context attribute="Normal Text" lineEndContext="#pop#pop" name="BuiltinLetArg" fallthroughContext="#pop!BuiltinLetExpr"> |
| 1177 |
<DetectChar context="#pop#pop" char="#" lookAhead="1"/> |
| 1178 |
</context> |
| 1179 |
<context attribute="Normal Text" lineEndContext="#pop" name="BuiltinLetExpr" fallthroughContext="#pop!NormalOption"> |
| 1180 |
<DetectIdentifier attribute="Variable" context="#stay" /> |
| 1181 |
<AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/> |
| 1182 |
<AnyChar attribute="Operator" context="#stay" String="+-/%=^:"/> |
| 1183 |
<AnyChar context="Number" String="0123456789" lookAhead="1"/> |
| 1184 |
<DetectChar attribute="Parameter Expansion Operator" context="Subscript" char="["/> |
| 1185 |
<IncludeRules context="FindWord"/> |
| 1186 |
<DetectChar attribute="Error" context="#stay" char="#"/> |
| 1187 |
<DetectChar context="NormalMaybeBraceExpansion" char="{" lookAhead="1"/> |
| 1188 |
</context> |
| 1189 |
|
| 1190 |
<!-- ProcessSubst handles <(command) and >(command) --> |
| 1191 |
<context attribute="Normal Text" lineEndContext="#stay" name="ProcessSubst" fallthroughContext="Command"> |
| 1192 |
<DetectChar attribute="Redirection" context="#pop" char=")"/> |
| 1193 |
<IncludeRules context="Start"/> |
| 1194 |
</context> |
| 1195 |
|
| 1196 |
<!-- StringSQ consumes anything till ' --> |
| 1197 |
<context attribute="String SingleQ" lineEndContext="#stay" name="StringSQ"> |
| 1198 |
<DetectSpaces attribute="String SingleQ"/> |
| 1199 |
<DetectIdentifier attribute="String SingleQ"/> |
| 1200 |
<DetectChar attribute="String SingleQ" context="#pop" char="'"/> |
| 1201 |
</context> |
| 1202 |
|
| 1203 |
<!-- StringDQ consumes anything till ", substitutes vars and expressions --> |
| 1204 |
<context attribute="String DoubleQ" lineEndContext="#stay" name="StringDQ"> |
| 1205 |
<DetectSpaces attribute="String DoubleQ"/> |
| 1206 |
<DetectIdentifier attribute="String DoubleQ"/> |
| 1207 |
<DetectChar attribute="String DoubleQ" context="#pop" char="""/> |
| 1208 |
<DetectChar context="StringDQEscape" char="\" lookAhead="1"/> |
| 1209 |
<DetectChar context="StringDQDispatchVariables" char="$" lookAhead="1"/> |
| 1210 |
<DetectChar attribute="Backquote" context="RegularBackq" char="`"/> |
| 1211 |
</context> |
| 1212 |
<context attribute="String DoubleQ" lineEndContext="#stay" name="StringDQDispatchVariables"> |
| 1213 |
<IncludeRules context="DispatchSubstVariables"/> |
| 1214 |
<IncludeRules context="DispatchVarnameVariables"/> |
| 1215 |
<DetectChar attribute="String DoubleQ" context="#pop" char="$"/> |
| 1216 |
</context> |
| 1217 |
<context attribute="String DoubleQ" lineEndContext="#pop" name="StringDQEscape"> |
| 1218 |
<Detect2Chars attribute="String Escape" context="#pop" char="\" char1="""/> |
| 1219 |
<Detect2Chars attribute="String Escape" context="#pop" char="\" char1="\"/> |
| 1220 |
<Detect2Chars attribute="String Escape" context="#pop" char="\" char1="`"/> |
| 1221 |
<Detect2Chars attribute="String Escape" context="#pop" char="\" char1="$"/> |
| 1222 |
<LineContinue attribute="String Escape" context="#pop"/> |
| 1223 |
<DetectChar attribute="String DoubleQ" context="#pop" char="\"/> |
| 1224 |
</context> |
| 1225 |
|
| 1226 |
<!-- RegularBackq consumes anything till ` --> |
| 1227 |
<context attribute="Normal Text" lineEndContext="#stay" name="RegularBackq" fallthroughContext="Command"> |
| 1228 |
<DetectChar attribute="Backquote" context="#pop" char="`"/> |
| 1229 |
<DetectChar attribute="Comment" context="CommentBackq" char="#"/> |
| 1230 |
<IncludeRules context="Start"/> |
| 1231 |
</context> |
| 1232 |
|
| 1233 |
<!-- StringEsc eats till ', but escaping many characters --> |
| 1234 |
<context attribute="String SingleQ" lineEndContext="#stay" name="StringEsc"> |
| 1235 |
<DetectSpaces attribute="String SingleQ"/> |
| 1236 |
<DetectIdentifier attribute="String SingleQ"/> |
| 1237 |
<DetectChar attribute="String SingleQ" context="#pop" char="'"/> |
| 1238 |
<RegExpr attribute="String Escape" context="#stay" String="\\(?:[abefnrtv\\']|[0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)"/> |
| 1239 |
</context> |
| 1240 |
|
| 1241 |
<context attribute="Normal Text" lineEndContext="#stay" name="FindWord"> |
| 1242 |
<IncludeRules context="FindStrings"/> |
| 1243 |
<DetectChar context="RegularVariable" char="$" lookAhead="1"/> |
| 1244 |
<DetectChar attribute="Backquote" context="RegularBackq" char="`"/> |
| 1245 |
<DetectChar context="AssumeEscape" char="\" lookAhead="1"/> |
| 1246 |
</context> |
| 1247 |
<context attribute="Normal Text" lineEndContext="#pop" name="RegularVariable"> |
| 1248 |
<IncludeRules context="DispatchVariables"/> |
| 1249 |
<DetectChar attribute="Normal Text" context="#pop" char="$"/> |
| 1250 |
</context> |
| 1251 |
|
| 1252 |
<context attribute="Normal Text" lineEndContext="#pop" name="FindStrings"> |
| 1253 |
<DetectChar attribute="String SingleQ" context="StringSQ" char="'"/> |
| 1254 |
<DetectChar attribute="String DoubleQ" context="StringDQ" char="""/> |
| 1255 |
</context> |
| 1256 |
|
| 1257 |
<!-- SubstCommand is called after a $( is encountered --> |
| 1258 |
<context attribute="Normal Text" lineEndContext="#stay" name="SubstCommand" fallthroughContext="Command"> |
| 1259 |
<DetectChar attribute="Parameter Expansion" context="#pop" char=")" endRegion="subshell"/> |
| 1260 |
<IncludeRules context="Start"/> |
| 1261 |
</context> |
| 1262 |
|
| 1263 |
<!-- VarBraceStart is called as soon as ${ is encoutered --> |
| 1264 |
<context attribute="Variable" lineEndContext="#pop!VarBrace" name="VarBraceStart" fallthroughContext="#pop!VarBrace"> |
| 1265 |
<DetectChar attribute="Parameter Expansion Operator" context="#pop!VarBracePrefix" char="!"/> |
| 1266 |
<DetectChar attribute="Parameter Expansion Operator" context="#pop!VarBrace" char="#"/> |
| 1267 |
</context> |
| 1268 |
|
| 1269 |
<!-- VarBracePrefix called as soon as ${! is encoutered --> |
| 1270 |
<context attribute="Variable" lineEndContext="#pop" name="VarBracePrefix"> |
| 1271 |
<DetectIdentifier attribute="Variable" context="#pop!VarBracePrefixSuffix"/> |
| 1272 |
<Int attribute="Variable" context="#pop!VarBracePrefixSuffix"/> |
| 1273 |
<AnyChar attribute="Parameter Expansion Operator" context="#pop!VarBracePrefixSharp" String="@*#"/> |
| 1274 |
</context> |
| 1275 |
<context attribute="Variable" lineEndContext="#pop" name="VarBracePrefixSuffix" fallthroughContext="#pop!VarError"> |
| 1276 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 1277 |
<AnyChar attribute="Parameter Expansion Operator" context="#stay" String="@*"/> |
| 1278 |
<StringDetect attribute="Parameter Expansion Operator" context="#stay" String="[@]"/> |
| 1279 |
<StringDetect attribute="Parameter Expansion Operator" context="#stay" String="[*]"/> |
| 1280 |
</context> |
| 1281 |
<context attribute="Variable" lineEndContext="#pop" name="VarBracePrefixSharp" fallthroughContext="#pop!VarError"> |
| 1282 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 1283 |
<DetectChar attribute="Parameter Expansion Operator" char="#"/> |
| 1284 |
</context> |
| 1285 |
|
| 1286 |
<!-- VarBrace is called as soon as ${ or ${# are encoutered --> |
| 1287 |
<context attribute="Variable" lineEndContext="#stay" name="VarBrace" fallthroughContext="#pop!VarError"> |
| 1288 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 1289 |
<DetectIdentifier attribute="Variable" context="#pop!CheckVarAlt"/> |
| 1290 |
<AnyChar attribute="Variable" context="#pop!CheckVarAlt" String="*@?$!-"/> |
| 1291 |
<Int attribute="Variable" context="#pop!CheckVarAlt" additionalDeliminator=":#%^,/@{}"/> |
| 1292 |
</context> |
| 1293 |
<context attribute="Error" lineEndContext="#stay" name="VarError"> |
| 1294 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 1295 |
</context> |
| 1296 |
<context attribute="Normal Text" lineEndContext="#stay" name="CheckVarAlt" fallthroughContext="#pop!VarError"> |
| 1297 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 1298 |
<StringDetect attribute="Parameter Expansion Operator" context="#stay" String="[@]"/> |
| 1299 |
<StringDetect attribute="Parameter Expansion Operator" context="#stay" String="[*]"/> |
| 1300 |
<DetectChar attribute="Parameter Expansion Operator" context="Subscript" char="["/> |
| 1301 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char=":" char1="-"/> |
| 1302 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char=":" char1="="/> |
| 1303 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char=":" char1="?"/> |
| 1304 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char=":" char1="+"/> |
| 1305 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char="#" char1="#"/> |
| 1306 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char="%" char1="%"/> |
| 1307 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternatePatternValue" char="^" char1="^"/> |
| 1308 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternatePatternValue" char="," char1=","/> |
| 1309 |
<DetectChar attribute="Parameter Expansion Operator" context="#pop!VarSub" char=":"/> |
| 1310 |
<DetectChar attribute="Parameter Expansion Operator" context="#pop!VarSubst" char="/"/> |
| 1311 |
<AnyChar attribute="Parameter Expansion Operator" context="#pop!AlternateValue" String="-+=?#%"/> |
| 1312 |
<AnyChar attribute="Parameter Expansion Operator" context="#pop!AlternatePatternValue" String="^,"/> |
| 1313 |
<DetectChar attribute="Parameter Expansion Operator" context="#pop!VarTransformation" char="@"/> |
| 1314 |
</context> |
| 1315 |
|
| 1316 |
<!-- called as soon as ${xxx: is encoutered --> |
| 1317 |
<context attribute="Normal Text" lineEndContext="#stay" name="VarSub"> |
| 1318 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 1319 |
<!-- <Int> doesn't match :3 because : is a weakDeliminator --> |
| 1320 |
<AnyChar attribute="Decimal" String="0123456789"/> |
| 1321 |
<DetectChar attribute="Parameter Expansion Operator" context="#stay" char=":"/> |
| 1322 |
<DetectChar context="VarVariables" char="$" lookAhead="1"/> |
| 1323 |
<IncludeRules context="FindStrings"/> |
| 1324 |
<DetectChar attribute="Backquote" context="RegularBackq" char="`"/> |
| 1325 |
<DetectChar context="AssumeEscape" char="\" lookAhead="1"/> |
| 1326 |
</context> |
| 1327 |
<context attribute="Command" lineEndContext="#pop" name="VarVariables"> |
| 1328 |
<IncludeRules context="DispatchVariables"/> |
| 1329 |
<DetectChar attribute="Error" context="#pop" char="$"/> |
| 1330 |
</context> |
| 1331 |
|
| 1332 |
<!-- called as soon as ${xxx:- ${xxx:= ${xxx:? ${xxx:+ ${xxx# ${xxx% and ${xxx are encoutered --> |
| 1333 |
<context attribute="Normal Text" lineEndContext="#stay" name="AlternateValue"> |
| 1334 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 1335 |
<IncludeRules context="FindWord"/> |
| 1336 |
<IncludeRules context="FindPathThenPopInAlternateValue"/> |
| 1337 |
<DetectIdentifier attribute="Normal Text"/> |
| 1338 |
</context> |
| 1339 |
|
| 1340 |
<!-- called as soon as ${xxx^ are ${xxx, are encoutered --> |
| 1341 |
<context attribute="Pattern" lineEndContext="#stay" name="AlternatePatternValue"> |
| 1342 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 1343 |
<IncludeRules context="FindWord"/> |
| 1344 |
<IncludeRules context="FindPattern"/> |
| 1345 |
<DetectIdentifier attribute="Pattern"/> |
| 1346 |
</context> |
| 1347 |
|
| 1348 |
<!-- called as soon as ${xxx/ is encoutered --> |
| 1349 |
<context attribute="Normal Text" lineEndContext="#stay" name="VarSubst" fallthroughContext="#pop!VarSubstPat"> |
| 1350 |
<AnyChar attribute="Parameter Expansion Operator" context="#pop!VarSubstPat" String="/#%"/> |
| 1351 |
</context> |
| 1352 |
<context attribute="Pattern" lineEndContext="#stay" name="VarSubstPat"> |
| 1353 |
<DetectChar attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char="/"/> |
| 1354 |
<IncludeRules context="AlternatePatternValue"/> |
| 1355 |
</context> |
| 1356 |
|
| 1357 |
<!-- called as soon as ${xxx@ is encoutered --> |
| 1358 |
<context attribute="Normal Text" lineEndContext="#stay" name="VarTransformation" fallthroughContext="#pop!VarError"> |
| 1359 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 1360 |
<AnyChar attribute="Parameter Expansion" context="#stay" String="QEPAa"/> |
| 1361 |
</context> |
| 1362 |
|
| 1363 |
<context attribute="Escape" lineEndContext="#pop" name="BraceExpansion"> |
| 1364 |
<DetectChar attribute="Escape" context="#pop!BraceExpansion2" char="{"/> |
| 1365 |
</context> |
| 1366 |
<context attribute="Escape" lineEndContext="#pop" name="BraceExpansion2"> |
| 1367 |
<DetectChar attribute="Operator" context="#stay" char=","/> |
| 1368 |
<DetectChar attribute="Escape" context="#pop" char="}"/> |
| 1369 |
<DetectChar context="EscapeMaybeBraceExpansion" char="{" lookAhead="1"/> |
| 1370 |
<DetectChar context="AssumeEscape" char="\" lookAhead="1"/> |
| 1371 |
<DetectChar attribute="Backquote" context="CommandBackq" char="`"/> |
| 1372 |
<DetectChar context="BraceExpansionVariables" char="$" lookAhead="1"/> |
| 1373 |
<IncludeRules context="FindStrings"/> |
| 1374 |
<IncludeRules context="FindPattern"/> |
| 1375 |
<DetectIdentifier attribute="Escape"/> |
| 1376 |
</context> |
| 1377 |
<context attribute="Escape" lineEndContext="#pop" name="EscapeMaybeBraceExpansion"> |
| 1378 |
<IncludeRules context="DispatchBraceExpansion"/> |
| 1379 |
<DetectChar attribute="Escape" context="#pop!BraceExpansion2" char="{"/> |
| 1380 |
</context> |
| 1381 |
<context attribute="Escape" lineEndContext="#pop" name="BraceExpansionVariables"> |
| 1382 |
<IncludeRules context="DispatchVariables"/> |
| 1383 |
<DetectChar attribute="Escape" context="#pop" char="$"/> |
| 1384 |
</context> |
| 1385 |
|
| 1386 |
<context attribute="Normal Text" lineEndContext="#pop" name="SequenceExpression"> |
| 1387 |
<AnyChar attribute="Decimal" context="#stay" String="0123456789-+"/> |
| 1388 |
<Detect2Chars attribute="Escape" context="#stay" char="." char1="."/> |
| 1389 |
<DetectChar attribute="Escape" context="#pop" char="}"/> |
| 1390 |
</context> |
| 1391 |
|
| 1392 |
<!-- ====== These are the contexts that can be branched to ======= --> |
| 1393 |
|
| 1394 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParenOrSubShell"> |
| 1395 |
<RegExpr attribute="Keyword" context="#pop!SubShell" String="\((?=&arithmetic_as_subshell;)|" beginRegion="subshell"/> |
| 1396 |
<Detect2Chars attribute="Keyword" context="#pop!ExprDblParen" char="(" char1="(" beginRegion="expression"/> |
| 1397 |
</context> |
| 1398 |
<!-- ExprDblParen consumes an expression started in command mode till )) --> |
| 1399 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParen"> |
| 1400 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1401 |
<Detect2Chars attribute="Keyword" context="#pop" char=")" char1=")" endRegion="expression"/> |
| 1402 |
<IncludeRules context="FindExprDblParen"/> |
| 1403 |
<!-- ((cmd |
| 1404 |
) # jump to SubShell context --> |
| 1405 |
<DetectChar attribute="Keyword" context="#pop!SubShell" char=")" endRegion="expression" beginRegion="subshell"/> |
| 1406 |
</context> |
| 1407 |
<context attribute="Normal Text" lineEndContext="#stay" name="FindExprDblParen"> |
| 1408 |
<Detect2Chars attribute="Control" context="#stay" char="&" char1="&"/> |
| 1409 |
<Detect2Chars attribute="Control" context="#stay" char="|" char1="|"/> |
| 1410 |
<AnyChar attribute="Operator" context="#stay" String="+-!~*/%<>=&^|?:"/> |
| 1411 |
<AnyChar context="Number" String="0123456789" lookAhead="1"/> |
| 1412 |
<DetectChar attribute="Control" context="#stay" char=","/> |
| 1413 |
<DetectChar attribute="Normal Text" context="ExprSubDblParen" char="("/> |
| 1414 |
<DetectChar attribute="Parameter Expansion Operator" context="Subscript" char="["/> |
| 1415 |
<IncludeRules context="FindWord"/> |
| 1416 |
<DetectChar attribute="Error" context="#stay" char="#"/> |
| 1417 |
<DetectChar context="MaybeArithmeticBrace" char="{" lookAhead="1"/> |
| 1418 |
<DetectIdentifier attribute="Variable" context="#stay"/> |
| 1419 |
</context> |
| 1420 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprSubDblParen"> |
| 1421 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1422 |
<DetectChar attribute="Normal Text" context="#pop" char=")"/> |
| 1423 |
<IncludeRules context="FindExprDblParen"/> |
| 1424 |
</context> |
| 1425 |
<context attribute="Normal Text" lineEndContext="#pop" name="MaybeArithmeticBrace"> |
| 1426 |
<IncludeRules context="DispatchBraceExpansion"/> |
| 1427 |
<DetectChar attribute="Error" context="#pop" char="{"/> |
| 1428 |
</context> |
| 1429 |
|
| 1430 |
<context attribute="Decimal" lineEndContext="#pop" name="Number"> |
| 1431 |
<HlCHex attribute="Hex" context="#pop" additionalDeliminator="&weakDeliminatorSymbols;"/> |
| 1432 |
<HlCOct attribute="Octal" context="#pop!NumberError" additionalDeliminator="&weakDeliminatorSymbols;"/> |
| 1433 |
<RegExpr attribute="Base" context="#pop!BaseN" String="[1-9][0-9]*#"/> |
| 1434 |
<DetectChar attribute="Decimal" context="#pop!NumberError" char="0"/> |
| 1435 |
<Int attribute="Decimal" context="#pop" additionalDeliminator="&weakDeliminatorSymbols;"/> |
| 1436 |
</context> |
| 1437 |
<context attribute="BaseN" lineEndContext="#pop" name="BaseN" fallthroughContext="#pop"> |
| 1438 |
<RegExpr attribute="BaseN" context="#pop" String="[0-9a-zA-Z@_]+"/> |
| 1439 |
</context> |
| 1440 |
<context attribute="Error" lineEndContext="#pop" name="NumberError" fallthroughContext="#pop"> |
| 1441 |
<Int attribute="Error" context="#pop" additionalDeliminator="0123456789"/> |
| 1442 |
</context> |
| 1443 |
|
| 1444 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParenSubstOrSubstCommand"> |
| 1445 |
<RegExpr attribute="Parameter Expansion" context="#pop!SubstCommand" String="\$\((?=&arithmetic_as_subshell;)|" beginRegion="subshell"/> |
| 1446 |
<StringDetect attribute="Parameter Expansion" context="#pop!ExprDblParenSubst" String="$((" beginRegion="expression"/> |
| 1447 |
</context> |
| 1448 |
<!-- ExprDblParenSubst like ExprDblParen but matches )) as Variable --> |
| 1449 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParenSubst"> |
| 1450 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1451 |
<Detect2Chars attribute="Parameter Expansion" context="#pop" char=")" char1=")" endRegion="expression"/> |
| 1452 |
<IncludeRules context="FindExprDblParen"/> |
| 1453 |
<!-- $((cmd |
| 1454 |
) # jump to SubstCommand context --> |
| 1455 |
<DetectChar attribute="Parameter Expansion" context="#pop!SubstCommand" char=")" endRegion="expression" beginRegion="subshell"/> |
| 1456 |
</context> |
| 1457 |
|
| 1458 |
<!-- ExprBracket consumes an expression till ] --> |
| 1459 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracket" fallthroughContext="#pop!ExprBracketNot"> |
| 1460 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1461 |
<IncludeRules context="FindExprBracketEnd"/> |
| 1462 |
</context> |
| 1463 |
|
| 1464 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketNot" fallthroughContext="#pop!ExprBracketParam1"> |
| 1465 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprBracketParam1"/> |
| 1466 |
<Detect2Chars attribute="Expression" context="ExprBracketTestMaybeNot" char="!" char1=" " lookAhead="1"/> |
| 1467 |
<Detect2Chars attribute="Expression" context="ExprBracketTestMaybeNot" char="!" char1="&tab;" lookAhead="1"/> |
| 1468 |
</context> |
| 1469 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprBracketTestMaybeNot"> |
| 1470 |
<DetectChar attribute="Expression" context="#pop" char="!"/> |
| 1471 |
</context> |
| 1472 |
|
| 1473 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketParam1" fallthroughContext="ExprBracketValue"> |
| 1474 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprBracketParam2"/> |
| 1475 |
<DetectChar context="TestMaybeUnary" char="-" lookAhead="1"/> |
| 1476 |
<IncludeRules context="FindExprBracketEnd"/> |
| 1477 |
</context> |
| 1478 |
|
| 1479 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprBracketValue"> |
| 1480 |
<AnyChar attribute="Error" context="#stay" String="&symbolseps;"/> |
| 1481 |
<AnyChar context="#pop" String=" &tab;" lookAhead="1"/> |
| 1482 |
<IncludeRules context="FindWord"/> |
| 1483 |
<DetectChar context="NormalMaybeBraceExpansion" char="{" lookAhead="1"/> |
| 1484 |
<IncludeRules context="FindNormalText"/> |
| 1485 |
</context> |
| 1486 |
|
| 1487 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketParam2" fallthroughContext="ExprBracketValue"> |
| 1488 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprBracketParam3"/> |
| 1489 |
<AnyChar context="TestMaybeBinary" String="-=!" lookAhead="1"/> |
| 1490 |
<IncludeRules context="FindExprBracketEnd"/> |
| 1491 |
</context> |
| 1492 |
|
| 1493 |
<context attribute="Normal Text" lineEndContext="ExprBracketFinal" name="ExprBracketParam3" fallthroughContext="ExprBracketValue"> |
| 1494 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprBracketFinal"/> |
| 1495 |
<IncludeRules context="FindExprBracketEnd"/> |
| 1496 |
</context> |
| 1497 |
|
| 1498 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketFinal" fallthroughContext="ExprBracketValue"> |
| 1499 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1500 |
<IncludeRules context="FindExprBracketEnd"/> |
| 1501 |
<RegExpr attribute="Expression" context="#pop!ExprBracket" String="-[ao]&eos;"/> |
| 1502 |
<RegExpr attribute="Error" context="#pop" String="(?:[^] &tab;]++|\][^ &tab;])++" endRegion="expression"/> |
| 1503 |
</context> |
| 1504 |
|
| 1505 |
<context attribute="Normal Text" lineEndContext="#stay" name="FindExprBracketEnd"> |
| 1506 |
<LineContinue attribute="Escape" context="#stay"/> |
| 1507 |
<RegExpr attribute="Builtin" context="#pop" String="\](?=($|[ &tab;;|&<>)]))" endRegion="expression"/> |
| 1508 |
</context> |
| 1509 |
|
| 1510 |
<context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeUnary" fallthroughContext="#pop!ExprBracketValue"> |
| 1511 |
<RegExpr attribute="Expression" context="#pop#pop!ExprBracketParam2" String="&unary_operators;"/> |
| 1512 |
</context> |
| 1513 |
<context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeBinary" fallthroughContext="#pop!ExprBracketValue"> |
| 1514 |
<RegExpr attribute="Expression" context="#pop" String="&binary_operators;"/> |
| 1515 |
</context> |
| 1516 |
|
| 1517 |
|
| 1518 |
<!-- ExprDblBracket consumes an expression till ]] --> |
| 1519 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracket" fallthroughContext="#pop!ExprDblBracketNot"> |
| 1520 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1521 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 1522 |
<IncludeRules context="FindExprDblBracketEnd"/> |
| 1523 |
</context> |
| 1524 |
|
| 1525 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketNot" fallthroughContext="#pop!ExprDblBracketParam1"> |
| 1526 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam1"/> |
| 1527 |
<DetectChar context="ExprDblBracketTestMaybeNot" char="!" lookAhead="1"/> |
| 1528 |
</context> |
| 1529 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketTestMaybeNot" fallthroughContext="#pop#pop!ExprDblBracketParam1"> |
| 1530 |
<RegExpr attribute="Expression" context="#pop" String="!(?=$|[ &tab;(])"/> |
| 1531 |
</context> |
| 1532 |
|
| 1533 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam1" fallthroughContext="ExprDblBracketValueText"> |
| 1534 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam2"/> |
| 1535 |
<DetectChar context="TestMaybeUnary2" char="-" lookAhead="1"/> |
| 1536 |
<AnyChar attribute="Expression" context="#pop!ExprDblBracketParam3Spe" String="<>"/> |
| 1537 |
<IncludeRules context="FindExprDblBracketEnd"/> |
| 1538 |
</context> |
| 1539 |
<context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeUnary2" fallthroughContext="#pop!ExprDblBracketValueText"> |
| 1540 |
<RegExpr attribute="Expression" context="#pop!ExprDblBracketUnary" String="&unary_operators;(?!\s+(?:=~|&binary_operators;))"/> |
| 1541 |
</context> |
| 1542 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketUnary"> |
| 1543 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketValueText"/> |
| 1544 |
</context> |
| 1545 |
|
| 1546 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValueText" fallthroughContext="#pop!ExprDblBracketValueText2"> |
| 1547 |
<Detect2Chars context="#pop!ExprDblBracketValueTextMaybeEnd" char="]" char1="]" lookAhead="1"/> |
| 1548 |
<DetectChar attribute="Error" context="#pop!Comment" char="#"/> |
| 1549 |
<IncludeRules context="FindExprDblBracketValueTextPath"/> |
| 1550 |
</context> |
| 1551 |
<context attribute="Normal Text" lineEndContext="#pop" name="FindExprDblBracketValueTextPath"> |
| 1552 |
<RegExpr context="#pop!ExprDblBracketValueTextPath" String="&path_with_sep;|" lookAhead="1"/> |
| 1553 |
</context> |
| 1554 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValueTextMaybeEnd"> |
| 1555 |
<RegExpr attribute="Keyword" context="#pop#pop" String="&dblbracket_close;" endRegion="expression"/> |
| 1556 |
<IncludeRules context="FindExprDblBracketValueTextPath"/> |
| 1557 |
<Detect2Chars context="#pop!ExprDblBracketValueText2" char="]" char1="]" lookAhead="1"/> |
| 1558 |
</context> |
| 1559 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValueText2"> |
| 1560 |
<DetectIdentifier/> |
| 1561 |
<AnyChar String="*?+!@~^:%+-/,"/> |
| 1562 |
<IncludeRules context="ExprDblBracketValueCommon"/> |
| 1563 |
</context> |
| 1564 |
<context attribute="Path" lineEndContext="#pop" name="ExprDblBracketValueTextPath"> |
| 1565 |
<IncludeRules context="ExprDblBracketValueText2"/> |
| 1566 |
</context> |
| 1567 |
|
| 1568 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValuePattern" fallthroughContext="#pop!ExprDblBracketValuePattern2"> |
| 1569 |
<RegExpr context="PathThenPop" String="&path_with_sep;|" lookAhead="1"/> |
| 1570 |
</context> |
| 1571 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValuePattern2"> |
| 1572 |
<DetectIdentifier attribute="Normal Text"/> |
| 1573 |
<IncludeRules context="ExprDblBracketValueCommon"/> |
| 1574 |
<IncludeRules context="FindExprDblBracketValueExtGlob"/> |
| 1575 |
<AnyChar attribute="Glob" String="?*"/> |
| 1576 |
</context> |
| 1577 |
<context attribute="Glob" lineEndContext="#stay" name="FindExprDblBracketValueExtGlob"> |
| 1578 |
<Detect2Chars attribute="Glob" context="ExprDblBracketValueExtGlob" char="?" char1="("/> |
| 1579 |
<Detect2Chars attribute="Glob" context="ExprDblBracketValueExtGlob" char="*" char1="("/> |
| 1580 |
<Detect2Chars attribute="Glob" context="ExprDblBracketValueExtGlob" char="+" char1="("/> |
| 1581 |
<Detect2Chars attribute="Glob" context="ExprDblBracketValueExtGlob" char="@" char1="("/> |
| 1582 |
<Detect2Chars attribute="Glob" context="ExprDblBracketValueExtGlob" char="!" char1="("/> |
| 1583 |
<DetectChar context="ExprDblBracketValueMaybeGlobAny" char="[" lookAhead="1"/> |
| 1584 |
</context> |
| 1585 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketValueMaybeGlobAny" fallthroughContext="#pop"> |
| 1586 |
<IncludeRules context="FindGlobAny"/> |
| 1587 |
<DetectChar attribute="Normal Text" context="#pop" char="["/> |
| 1588 |
</context> |
| 1589 |
<context attribute="Normal Text" lineEndContext="#pop#pop" name="ExprDblBracketValueExtGlob"> |
| 1590 |
<DetectIdentifier attribute="Normal Text"/> |
| 1591 |
<DetectChar attribute="Glob" context="#pop" char=")"/> |
| 1592 |
<DetectChar attribute="Normal Text" context="ExprDblBracketValueExtGlobNormal" char="("/> |
| 1593 |
<IncludeRules context="FindExprDblBracketValueExtGlob"/> |
| 1594 |
<AnyChar attribute="Glob" String="|?*"/> |
| 1595 |
<IncludeRules context="FindWord"/> |
| 1596 |
</context> |
| 1597 |
<context attribute="Normal Text" lineEndContext="#pop#pop" name="ExprDblBracketValueExtGlobNormal"> |
| 1598 |
<DetectIdentifier attribute="Normal Text"/> |
| 1599 |
<DetectChar attribute="Normal Text" context="#pop" char=")"/> |
| 1600 |
<DetectChar attribute="Normal Text" context="ExprDblBracketValueExtGlobNormal" char="("/> |
| 1601 |
<IncludeRules context="FindExprDblBracketValueExtGlob"/> |
| 1602 |
<AnyChar attribute="Glob" String="?*"/> |
| 1603 |
<IncludeRules context="FindWord"/> |
| 1604 |
</context> |
| 1605 |
|
| 1606 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValueCommon"> |
| 1607 |
<Detect2Chars context="ExprDblBracketDblParentOrSubValue" char="(" char1="(" lookAhead="1"/> |
| 1608 |
<DetectChar context="ExprDblBracketSubValue" char="(" lookAhead="1"/> |
| 1609 |
<DetectChar attribute="Operator" context="#pop#pop" char=")"/> |
| 1610 |
<Detect2Chars attribute="Control" context="#pop#pop!ExprDblBracket" char="&" char1="&"/> |
| 1611 |
<Detect2Chars attribute="Control" context="#pop#pop!ExprDblBracket" char="|" char1="|"/> |
| 1612 |
<AnyChar attribute="Error" context="#stay" String="|&;"/> |
| 1613 |
<AnyChar context="#pop" String=" &tab;<>" lookAhead="1"/> |
| 1614 |
<IncludeRules context="FindWord"/> |
| 1615 |
</context> |
| 1616 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketSubValue" fallthroughContext="#pop"> |
| 1617 |
<DetectChar attribute="Operator" context="ExprDblBracketNot" char="("/> |
| 1618 |
<Detect2Chars context="#pop#pop" char="]" char1="]" lookAhead="1"/> |
| 1619 |
</context> |
| 1620 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketDblParentOrSubValue"> |
| 1621 |
<RegExpr context="#pop!ExprDblBracketSubValue" String="\((?=&arithmetic_as_subshell;)|" lookAhead="1"/> |
| 1622 |
<Detect2Chars attribute="Keyword" context="#pop!ExprDblBracketExprDblParen" char="(" char1="(" beginRegion="expression"/> |
| 1623 |
</context> |
| 1624 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketExprDblParen"> |
| 1625 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1626 |
<Detect2Chars attribute="Keyword" context="#pop" char=")" char1=")" endRegion="expression"/> |
| 1627 |
<IncludeRules context="FindExprDblParen"/> |
| 1628 |
<!-- ((cmd |
| 1629 |
) # jump to ExprDblBracketValuePattern context --> |
| 1630 |
<DetectChar attribute="Operator" context="ExprDblBracketValuePattern" char=")" endRegion="expression" beginRegion="subshell"/> |
| 1631 |
</context> |
| 1632 |
|
| 1633 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam2" fallthroughContext="ExprDblBracketValuePattern"> |
| 1634 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam3"/> |
| 1635 |
<AnyChar context="TestMaybeBinary2" String="-=!" lookAhead="1"/> |
| 1636 |
<AnyChar attribute="Expression" context="#pop!ExprDblBracketParam3Spe" String="<>"/> |
| 1637 |
<IncludeRules context="FindExprDblBracketEnd"/> |
| 1638 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 1639 |
</context> |
| 1640 |
<context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeBinary2" fallthroughContext="#pop!ExprDblBracketValuePattern"> |
| 1641 |
<IncludeRules context="TestMaybeBinary"/> |
| 1642 |
<RegExpr attribute="Expression" context="#pop!ExprDblBracketRegex" String="=~(?=[ &tab;(])"/> |
| 1643 |
</context> |
| 1644 |
|
| 1645 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam3Spe" fallthroughContext="#pop!ExprDblBracketParam3"> |
| 1646 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam3"/> |
| 1647 |
</context> |
| 1648 |
|
| 1649 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam3" fallthroughContext="ExprDblBracketValuePattern"> |
| 1650 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketFinal"/> |
| 1651 |
<IncludeRules context="FindExprDblBracketEnd"/> |
| 1652 |
<AnyChar attribute="Error" context="#stay" String="<>"/> |
| 1653 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 1654 |
</context> |
| 1655 |
|
| 1656 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketFinal" fallthroughContext="ExprDblBracketValuePattern"> |
| 1657 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1658 |
<IncludeRules context="FindExprDblBracketEnd"/> |
| 1659 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 1660 |
<DetectChar attribute="Operator" context="#pop" char=")"/> |
| 1661 |
<RegExpr attribute="Error" context="#pop" String="(?:[^] &tab;]++|\](?:[^]]|\][^ &tab;]))++" endRegion="expression"/> |
| 1662 |
</context> |
| 1663 |
|
| 1664 |
<context attribute="Normal Text" lineEndContext="#stay" name="FindExprDblBracketEnd"> |
| 1665 |
<LineContinue attribute="Escape" context="#stay"/> |
| 1666 |
<Detect2Chars attribute="Control" context="#pop!ExprDblBracket" char="&" char1="&"/> |
| 1667 |
<Detect2Chars attribute="Control" context="#pop!ExprDblBracket" char="|" char1="|"/> |
| 1668 |
<RegExpr attribute="Keyword" context="#pop" String="&dblbracket_close;" endRegion="expression"/> |
| 1669 |
</context> |
| 1670 |
|
| 1671 |
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketRegex" fallthroughContext="#pop!ExprDblBracketRegexCheck"> |
| 1672 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketRegexCheck"/> |
| 1673 |
</context> |
| 1674 |
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketRegexCheck" fallthroughContext="#pop#pop!Regex"> |
| 1675 |
<DetectChar attribute="Error" context="Comment" char="#"/> |
| 1676 |
</context> |
| 1677 |
<context attribute="Pattern" lineEndContext="#stay" name="Regex"> |
| 1678 |
<DetectIdentifier attribute="Pattern"/> |
| 1679 |
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketFinal"/> |
| 1680 |
<DetectChar attribute="Operator" context="#pop" char=")"/> |
| 1681 |
<Detect2Chars attribute="Operator" context="RegexChar" char="[" char1="^"/> |
| 1682 |
<DetectChar attribute="Operator" context="RegexChar" char="["/> |
| 1683 |
<IncludeRules context="FindRegex"/> |
| 1684 |
</context> |
| 1685 |
<context attribute="Pattern" lineEndContext="#stay" name="ExprDblBracketSubRegex"> |
| 1686 |
<DetectIdentifier attribute="Pattern"/> |
| 1687 |
<DetectSpaces attribute="Pattern" context="#stay"/> |
| 1688 |
<DetectChar attribute="Operator" context="#pop" char=")"/> |
| 1689 |
<Detect2Chars attribute="Operator" context="RegexSubChar" char="[" char1="^"/> |
| 1690 |
<DetectChar attribute="Operator" context="RegexSubChar" char="["/> |
| 1691 |
<IncludeRules context="FindRegex"/> |
| 1692 |
</context> |
| 1693 |
|
| 1694 |
<context attribute="Pattern" lineEndContext="#stay" name="FindRegex"> |
| 1695 |
<DetectChar attribute="Operator" context="ExprDblBracketSubRegex" char="("/> |
| 1696 |
<DetectChar attribute="Escape" context="RegexEscape" char="\"/> |
| 1697 |
<DetectChar attribute="Parameter Expansion" context="RegexDup" char="{"/> |
| 1698 |
<AnyChar attribute="Glob" context="#stay" String="^?+*.|"/> |
| 1699 |
<IncludeRules context="FindStrings"/> |
| 1700 |
<DetectChar context="RegexDispatchVariables" char="$" lookAhead="1"/> |
| 1701 |
<DetectChar attribute="Backquote" context="RegularBackq" char="`"/> |
| 1702 |
</context> |
| 1703 |
<context attribute="Normal Text" lineEndContext="#stay" name="RegexDispatchVariables"> |
| 1704 |
<IncludeRules context="DispatchVariables"/> |
| 1705 |
<DetectChar attribute="Operator" context="#pop" char="$"/> |
| 1706 |
</context> |
| 1707 |
|
| 1708 |
<context attribute="Normal Text" lineEndContext="#pop" name="RegexEscape"> |
| 1709 |
<RegExpr attribute="Escape" context="#pop" String="x[0-9a-fA-F]{1,2}|[0-7]{1,3}|."/> |
| 1710 |
</context> |
| 1711 |
|
| 1712 |
<context attribute="Normal Text" lineEndContext="#pop" name="RegexDup"> |
| 1713 |
<Int attribute="Decimal" additionalDeliminator="{"/> |
| 1714 |
<DetectChar attribute="Parameter Expansion Operator" context="#stay" char=","/> |
| 1715 |
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/> |
| 1716 |
</context> |
| 1717 |
|
| 1718 |
<context attribute="Pattern" lineEndContext="#pop" name="RegexSubChar" fallthroughContext="#pop!RegexSubInChar"> |
| 1719 |
<AnyChar attribute="Pattern" context="#pop!RegexSubInChar" String="-]"/> |
| 1720 |
</context> |
| 1721 |
<context attribute="Pattern" lineEndContext="#pop" name="RegexSubInChar"> |
| 1722 |
<DetectSpaces attribute="Pattern" context="#stay"/> |
| 1723 |
<IncludeRules context="RegexInChar"/> |
| 1724 |
</context> |
| 1725 |
|
| 1726 |
<context attribute="Pattern" lineEndContext="#pop" name="RegexChar" fallthroughContext="#pop!RegexInChar"> |
| 1727 |
<AnyChar attribute="Pattern" context="#pop!RegexInChar" String="-]"/> |
| 1728 |
</context> |
| 1729 |
<context attribute="Pattern" lineEndContext="#pop" name="RegexInChar"> |
| 1730 |
<Detect2Chars context="RegexInCharEnd" char="-" char1="]" lookAhead="1"/> |
| 1731 |
<DetectChar attribute="Operator" context="#stay" char="-"/> |
| 1732 |
<DetectChar attribute="Escape" context="RegexEscape" char="\"/> |
| 1733 |
<DetectChar context="RegexCharClassSelect" char="[" lookAhead="1"/> |
| 1734 |
<DetectChar attribute="Operator" context="#pop" char="]"/> |
| 1735 |
<AnyChar context="#pop" String="() &tab;" lookAhead="1"/> |
| 1736 |
<IncludeRules context="FindStrings"/> |
| 1737 |
</context> |
| 1738 |
<context attribute="Operator" lineEndContext="#stay" name="RegexInCharEnd"> |
| 1739 |
<DetectChar attribute="Pattern" context="#stay" char="-"/> |
| 1740 |
<DetectChar attribute="Operator" context="#pop#pop" char="]"/> |
| 1741 |
</context> |
| 1742 |
<context attribute="Parameter Expansion" lineEndContext="#pop#pop#pop" name="RegexCharClassSelect"> |
| 1743 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!RegexCharClass" char="[" char1=":"/> |
| 1744 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!RegexCollatingSymbols" char="[" char1="."/> |
| 1745 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop!RegexEquivalenceClass" char="[" char1="="/> |
| 1746 |
<DetectChar attribute="Pattern" context="#pop" char="["/> |
| 1747 |
</context> |
| 1748 |
|
| 1749 |
<context attribute="Parameter Expansion" lineEndContext="#pop#pop#pop" name="RegexCharClass"> |
| 1750 |
<DetectIdentifier attribute="Parameter Expansion"/> |
| 1751 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop" char=":" char1="]"/> |
| 1752 |
<DetectChar attribute="Error" context="#pop" char="]"/> |
| 1753 |
</context> |
| 1754 |
<context attribute="Parameter Expansion" lineEndContext="#pop#pop#pop" name="RegexCollatingSymbols"> |
| 1755 |
<DetectIdentifier attribute="Parameter Expansion"/> |
| 1756 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop" char="." char1="]"/> |
| 1757 |
<DetectChar attribute="Error" context="#pop" char="]"/> |
| 1758 |
</context> |
| 1759 |
<context attribute="Parameter Expansion" lineEndContext="#pop#pop#pop" name="RegexEquivalenceClass"> |
| 1760 |
<DetectIdentifier attribute="Parameter Expansion"/> |
| 1761 |
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop" char="=" char1="]"/> |
| 1762 |
<DetectChar attribute="Error" context="#pop" char="]"/> |
| 1763 |
</context> |
| 1764 |
|
| 1765 |
<!-- SubShell consumes shell input till ) --> |
| 1766 |
<context attribute="Normal Text" lineEndContext="#stay" name="SubShell" fallthroughContext="Command"> |
| 1767 |
<DetectChar attribute="Keyword" context="#pop" char=")" endRegion="subshell"/> |
| 1768 |
<IncludeRules context="Start"/> |
| 1769 |
</context> |
| 1770 |
|
| 1771 |
<!-- Assign consumes an expression till EOL or whitespace --> |
| 1772 |
<context attribute="Normal Text" lineEndContext="#pop" name="Assign" fallthroughContext="#pop!Assign2"> |
| 1773 |
<DetectChar attribute="Variable" context="#pop!AssignArray" char="("/> |
| 1774 |
</context> |
| 1775 |
<context attribute="Normal Text" lineEndContext="#pop" name="Assign2" fallthroughContext="#pop"> |
| 1776 |
<DetectChar attribute="Backquote" context="RegularBackq" char="`"/> |
| 1777 |
<IncludeRules context="NormalOption"/> |
| 1778 |
</context> |
| 1779 |
|
| 1780 |
<!-- AssignArray consumes everything till ), marking assignments --> |
| 1781 |
<context attribute="Normal Text" lineEndContext="#stay" name="AssignArray" fallthroughContext="NormalOption"> |
| 1782 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1783 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 1784 |
<DetectChar attribute="Variable" context="#pop!Assign2" char=")"/> |
| 1785 |
<DetectChar context="AssignArrayKey" char="[" lookAhead="1"/> |
| 1786 |
<DetectChar attribute="Backquote" context="AssignArrayBackq" char="`"/> |
| 1787 |
<AnyChar attribute="Error" context="#stay" String="&symbolseps;"/> |
| 1788 |
</context> |
| 1789 |
<context attribute="Normal Text" lineEndContext="#pop" name="AssignArrayKey" fallthroughContext="#pop"> |
| 1790 |
<DetectChar attribute="Parameter Expansion Operator" context="Subscript" char="["/> |
| 1791 |
<DetectChar attribute="Variable" context="#pop" char="="/> |
| 1792 |
</context> |
| 1793 |
<context attribute="Normal Text" lineEndContext="#stay" name="AssignArrayBackq" fallthroughContext="Command"> |
| 1794 |
<DetectChar attribute="Backquote" context="#pop!NormalOption" char="`"/> |
| 1795 |
<DetectChar attribute="Comment" context="CommentBackq" char="#"/> |
| 1796 |
<IncludeRules context="Start"/> |
| 1797 |
</context> |
| 1798 |
|
| 1799 |
<!-- Subscript consumes anything till ], marks as Variable --> |
| 1800 |
<context attribute="Normal Text" lineEndContext="#stay" name="Subscript" fallthroughContext="#pop!Subscript2"> |
| 1801 |
<DetectChar attribute="Parameter Expansion Operator" context="#pop" char="]"/> |
| 1802 |
<AnyChar attribute="Decimal" context="#stay" String="0123456789"/> |
| 1803 |
</context> |
| 1804 |
<context attribute="Normal Text" lineEndContext="#stay" name="Subscript2"> |
| 1805 |
<DetectIdentifier attribute="Normal Text"/> |
| 1806 |
<DetectChar attribute="Parameter Expansion Operator" context="#pop" char="]"/> |
| 1807 |
<IncludeRules context="FindWord"/> |
| 1808 |
<IncludeRules context="FindPattern"/> |
| 1809 |
</context> |
| 1810 |
|
| 1811 |
<!-- FunctionDef consumes a name, possibly with (), marks as Function --> |
| 1812 |
<context attribute="Function" lineEndContext="#pop" name="FunctionDef" fallthroughContext="#pop"> |
| 1813 |
<RegExpr attribute="Function" context="#pop" String="[ &tab;]+&funcname;(?:[ &tab;]*\(\))?"/> |
| 1814 |
</context> |
| 1815 |
|
| 1816 |
<!-- Case is called after the case keyword is encoutered. We handle this because of |
| 1817 |
the lonely closing parentheses that would otherwise disturb the expr matching --> |
| 1818 |
<context attribute="Normal Text" lineEndContext="#stay" name="Case"> |
| 1819 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1820 |
<WordDetect attribute="Keyword" context="#pop!CaseIn" String="in"/> |
| 1821 |
<IncludeRules context="FindWord"/> |
| 1822 |
<DetectIdentifier attribute="Normal Text" context="#stay"/> |
| 1823 |
</context> |
| 1824 |
|
| 1825 |
<!-- CaseIn is called when the construct 'case ... in' has been found. --> |
| 1826 |
<context attribute="Normal Text" lineEndContext="#stay" name="CaseIn" fallthroughContext="CasePattern"> |
| 1827 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1828 |
<DetectChar attribute="Keyword" context="CasePattern" char="("/> |
| 1829 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 1830 |
</context> |
| 1831 |
<context attribute="Pattern" lineEndContext="#stay" name="CasePattern"> |
| 1832 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 1833 |
<DetectChar attribute="Keyword" context="#pop!CaseExpr" char=")" beginRegion="caseexpr"/> |
| 1834 |
<DetectChar context="AssumeEscape" char="\" lookAhead="1"/> |
| 1835 |
<DetectChar attribute="Keyword" context="#stay" char="|"/> |
| 1836 |
<IncludeRules context="FindWord"/> |
| 1837 |
<IncludeRules context="FindPattern"/> |
| 1838 |
<WordDetect attribute="Control Flow" context="#pop#pop" String="esac" endRegion="case"/> |
| 1839 |
<DetectIdentifier attribute="Pattern" context="#stay"/> |
| 1840 |
</context> |
| 1841 |
|
| 1842 |
<!-- CaseExpr eats shell input till ;; / ;& / ;;& --> |
| 1843 |
<context attribute="Normal Text" lineEndContext="#stay" name="CaseExpr" fallthroughContext="Command"> |
| 1844 |
<StringDetect attribute="Control Flow" context="#pop" String=";;&" endRegion="caseexpr"/> |
| 1845 |
<Detect2Chars attribute="Control Flow" context="#pop" char=";" char1=";" endRegion="caseexpr"/> |
| 1846 |
<Detect2Chars attribute="Control Flow" context="#pop" char=";" char1="&" endRegion="caseexpr"/> |
| 1847 |
<WordDetect context="#pop" String="esac" endRegion="caseexpr" lookAhead="1"/> |
| 1848 |
<IncludeRules context="Start"/> |
| 1849 |
</context> |
| 1850 |
|
| 1851 |
</contexts> |
| 1852 |
|
| 1853 |
<itemDatas> |
| 1854 |
<itemData name="Normal Text" defStyleNum="dsNormal"/> |
| 1855 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 1856 |
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> |
| 1857 |
<itemData name="Control" defStyleNum="dsKeyword" spellChecking="false"/> |
| 1858 |
<itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/> |
| 1859 |
<itemData name="Builtin" defStyleNum="dsBuiltIn" spellChecking="false"/> |
| 1860 |
<itemData name="Command" defStyleNum="dsFunction" spellChecking="false"/> |
| 1861 |
<itemData name="OtherCommand" defStyleNum="dsExtension" spellChecking="false"/> |
| 1862 |
<itemData name="Redirection" defStyleNum="dsOperator" spellChecking="false"/> |
| 1863 |
<itemData name="Escape" defStyleNum="dsDataType" spellChecking="false"/> |
| 1864 |
<itemData name="String SingleQ" defStyleNum="dsString"/> |
| 1865 |
<itemData name="String DoubleQ" defStyleNum="dsString"/> |
| 1866 |
<itemData name="Here Doc" defStyleNum="dsString"/> |
| 1867 |
<itemData name="Backquote" defStyleNum="dsKeyword" spellChecking="false"/> |
| 1868 |
<itemData name="String Transl." defStyleNum="dsString"/> |
| 1869 |
<itemData name="String Escape" defStyleNum="dsDataType"/> |
| 1870 |
<itemData name="Variable" defStyleNum="dsVariable" spellChecking="false"/> |
| 1871 |
<itemData name="Dollar Prefix" defStyleNum="dsVariable" spellChecking="false"/> |
| 1872 |
<itemData name="Expression" defStyleNum="dsOthers" spellChecking="false"/> |
| 1873 |
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/> |
| 1874 |
<itemData name="Pattern" defStyleNum="dsSpecialString" spellChecking="false"/> |
| 1875 |
<itemData name="Path" defStyleNum="dsNormal" spellChecking="false"/> |
| 1876 |
<itemData name="Glob" defStyleNum="dsPreprocessor" spellChecking="false"/> |
| 1877 |
<itemData name="Option" defStyleNum="dsAttribute" spellChecking="false"/> |
| 1878 |
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/> |
| 1879 |
<itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false"/> |
| 1880 |
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/> |
| 1881 |
<itemData name="Base" defStyleNum="dsDataType" spellChecking="false"/> |
| 1882 |
<itemData name="BaseN" defStyleNum="dsBaseN" spellChecking="false"/> |
| 1883 |
<itemData name="File Descriptor" defStyleNum="dsDecVal" spellChecking="false"/> |
| 1884 |
<itemData name="Parameter Expansion" defStyleNum="dsVariable" spellChecking="false"/> |
| 1885 |
<itemData name="Parameter Expansion Operator" defStyleNum="dsOperator" spellChecking="false"/> |
| 1886 |
<itemData name="Operator" defStyleNum="dsOperator" spellChecking="false"/> |
| 1887 |
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/> |
| 1888 |
<itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false" /> |
| 1889 |
</itemDatas> |
| 1890 |
</highlighting> |
| 1891 |
<general> |
| 1892 |
<comments> |
| 1893 |
<comment name="singleLine" start="#"/> |
| 1894 |
</comments> |
| 1895 |
<keywords casesensitive="1" weakDeliminator="_&weakDeliminatorSymbols;" additionalDeliminator="`"/> |
| 1896 |
</general> |
| 1897 |
</language> |