<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY funcname "[A-Za-z_:][A-Za-z0-9_:#%@-]*">
<!ENTITY varname "[A-Za-z_][A-Za-z0-9_]*">
<!ENTITY word "[^|&;()<>\s]+"> <!-- see man bash -->
<!ENTITY eos "(?=($|\s))"> <!-- eol or space following -->
<!ENTITY noword "(?![\w$+-])"> <!-- no word, $, + or - following -->
<!ENTITY pathpart "([\w_@.%*?+-]|\\ )"> <!-- valid character in a file name -->
]>
<language name="Zsh" version="8" kateversion="5.53" section="Scripts" extensions="*.sh;*.zsh;.zshrc;.zprofile;.zlogin;.zlogout;.profile" mimetype="application/x-shellscript" casesensitive="1" author="Jonathan Kolberg (bulldog98@kubuntu-de.org)" license="LGPL">
<!-- (c) 2011 by Jonathan Kolberg (bulldog98@kubuntu-de.org)
modified for zsh -->
<!-- (c) 2004 by Wilbert Berendsen (wilbert@kde.nl)
Changes by Matthew Woehlke (mw_triad@users.sourceforge.net)
Changes by Sebastian Pipping (webmaster@hartwork.org)
Released under the LGPL, part of kdelibs/kate -->
<highlighting>
<list name="keywords">
<item>else</item>
<item>for</item>
<item>function</item>
<item>in</item>
<item>select</item>
<item>until</item>
<item>while</item>
<item>elif</item>
<item>then</item>
<item>set</item>
</list>
<list name="builtins"><!-- see man zshbuiltins -->
<item>-</item>
<item>.</item>
<item>:</item>
<item>alias</item>
<item>autoload</item>
<item>bg</item>
<item>bindkey</item>
<item>break</item>
<item>builtin</item>
<item>bye</item>
<item>cap</item>
<item>cd</item>
<item>chdir</item>
<item>clone</item>
<item>command</item>
<item>comparguments</item>
<item>compcall</item>
<item>compctl</item>
<item>compdescribe</item>
<item>compfiles</item>
<item>compgroups</item>
<item>compquote</item>
<item>comptags</item>
<item>comptry</item>
<item>compvalues</item>
<item>continue</item>
<item>dirs</item>
<item>disable</item>
<item>disown</item>
<item>echo</item>
<item>echotc</item>
<item>echoti</item>
<item>emulate</item>
<item>enable</item>
<item>eval</item>
<item>exec</item>
<item>exit</item>
<item>false</item>
<item>fc</item>
<item>fg</item>
<item>functions</item>
<item>getcap</item>
<item>getopts</item>
<item>hash</item>
<item>history</item>
<item>jobs</item>
<item>kill</item>
<item>let</item>
<item>limit</item>
<item>log</item>
<item>logout</item>
<item>noglob</item>
<item>popd</item>
<item>print</item>
<item>printf</item>
<item>pushd</item>
<item>pushln</item>
<item>pwd</item>
<item>r</item>
<item>rehash</item>
<item>return</item>
<item>sched</item>
<item>set</item>
<item>setcap</item>
<item>setopt</item>
<item>shift</item>
<item>source</item>
<item>stat</item>
<item>suspend</item>
<item>test</item>
<item>times</item>
<item>trap</item>
<item>true</item>
<item>ttyctl</item>
<item>type</item>
<item>ulimit</item>
<item>umask</item>
<item>unalias</item>
<item>unfunction</item>
<item>unhash</item>
<item>unlimit</item>
<item>unset</item>
<item>unsetopt</item>
<item>vared</item>
<item>wait</item>
<item>whence</item>
<item>where</item>
<item>which</item>
<item>zcompile</item>
<item>zformat</item>
<item>zftp</item>
<item>zle</item>
<item>zmodload</item>
<item>zparseopts</item>
<item>zprof</item>
<item>zpty</item>
<item>zregexparse</item>
<item>zsocket</item>
<item>zstyle</item>
<item>ztcp</item>
</list>
<list name="builtins_var">
<item>declare</item>
<item>export</item>
<item>float</item>
<item>getln</item>
<item>integer</item>
<item>unset</item>
<item>declare</item>
<item>typeset</item>
<item>local</item>
<item>read</item>
<item>readonly</item>
</list>
<list name="unixcommands">
<include>unixcommands##Bash</include>
</list>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Start">
<IncludeRules context="FindAll" />
</context>
<!-- ====== The following rulessets are meant to be included ======== -->
<!-- FindAll tries to interpret everything -->
<context attribute="Normal Text" lineEndContext="#stay" name="FindAll">
<IncludeRules context="FindComments" />
<IncludeRules context="FindCommands" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
<IncludeRules context="FindOthers" />
</context>
<!-- FindMost tries to interpret anything except commands -->
<context attribute="Normal Text" lineEndContext="#stay" name="FindMost">
<IncludeRules context="FindComments" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
<IncludeRules context="FindOthers" />
</context>
<!-- FindComments consumes shell comments till EOL -->
<context attribute="Normal Text" lineEndContext="#pop" name="FindComments">
<DetectChar attribute="Comment" context="Comment" char="#" firstNonSpace="true"/>
<RegExpr attribute="Normal Text" context="Comment" String="[\s;](?=#)" />
</context>
<context attribute="Comment" lineEndContext="#pop" name="Comment">
<DetectSpaces />
<IncludeRules context="##Comments" />
</context>
<!-- FindCommentsParen consumes shell comments till EOL or a closing parenthese -->
<context attribute="Normal Text" lineEndContext="#pop" name="FindCommentsParen">
<DetectChar attribute="Comment" context="CommentParen" char="#" firstNonSpace="true"/>
<RegExpr attribute="Normal Text" context="CommentParen" String="[\s;](?=#)" />
</context>
<context attribute="Comment" lineEndContext="#pop" name="CommentParen">
<RegExpr attribute="Comment" context="#pop" String="[^)](?=\))" />
<IncludeRules context="##Comments" />
</context>
<!-- FindCommentsBackq consumes shell comments till EOL or a backquote -->
<context attribute="Normal Text" lineEndContext="#pop" name="FindCommentsBackq">
<DetectChar attribute="Comment" context="CommentBackq" char="#" firstNonSpace="true"/>
<RegExpr attribute="Normal Text" context="CommentBackq" String="[\s;](?=#)" />
</context>
<context attribute="Comment" lineEndContext="#pop" name="CommentBackq">
<RegExpr attribute="Comment" context="#pop" String="[^`](?=`)" />
<IncludeRules context="##Comments" />
</context>
<!-- FindCommands matches many items that can be expected outside strings, substitutions etc. -->
<context attribute="Normal Text" lineEndContext="#stay" name="FindCommands">
<!-- start expression in double parentheses -->
<Detect2Chars attribute="Keyword" context="ExprDblParen" char="(" char1="(" beginRegion="expression" />
<!-- start expression in double brackets -->
<RegExpr attribute="Keyword" context="ExprDblBracket" String="\[\[&eos;" beginRegion="expression" column="0"/>
<RegExpr attribute="Keyword" context="ExprDblBracket" String="\s\[\[&eos;" beginRegion="expression" />
<!-- start expression in single brackets -->
<RegExpr attribute="Builtin" context="ExprBracket" String="\[&eos;" beginRegion="expression" column="0"/>
<RegExpr attribute="Builtin" context="ExprBracket" String="\s\[&eos;" beginRegion="expression" />
<!-- start a group command with { -->
<RegExpr attribute="Keyword" context="Group" String="\{&eos;" beginRegion="group" />
<!-- start a subshell -->
<DetectChar attribute="Keyword" context="SubShell" char="(" beginRegion="subshell" />
<!-- match do and if blocks -->
<RegExpr attribute="Keyword" context="#stay" String="\bdo&noword;" beginRegion="do" />
<RegExpr attribute="Keyword" context="#stay" String="\bdone&noword;" endRegion="do" />
<RegExpr attribute="Keyword" context="#stay" String="\bif&eos;" beginRegion="if" />
<RegExpr attribute="Keyword" context="#stay" String="\bfi&noword;" endRegion="if" />
<!-- handle case as a special case -->
<RegExpr attribute="Keyword" context="Case" String="\bcase&noword;" beginRegion="case" />
<!-- handle command line options -->
<RegExpr attribute="Option" context="#stay" String="-[A-Za-z0-9][A-Za-z0-9_]*" />
<RegExpr attribute="Option" context="#stay" String="--[a-z][A-Za-z0-9_-]*" />
<!-- handle variable assignments -->
<RegExpr attribute="Variable" context="Assign" String="\b&varname;\+?=" />
<RegExpr attribute="Variable" context="AssignSubscr" String="\b&varname;(?=\[.+\]\+?=)" />
<!-- handle functions with function keyword before keywords -->
<StringDetect attribute="Function" context="#stay" String=":()" />
<RegExpr attribute="Keyword" context="FunctionDef" String="\bfunction\b" />
<!-- handle keywords -->
<keyword attribute="Keyword" context="#stay" String="keywords" />
<RegExpr attribute="Builtin" context="#stay" String="\.(?=\s)" />
<keyword attribute="Builtin" context="#stay" String="builtins" />
<keyword attribute="Command" context="#stay" String="unixcommands" />
<!-- handle commands that have variable names as argument -->
<keyword attribute="Builtin" context="VarName" String="builtins_var" />
<!-- handle here-string -->
<RegExpr attribute="Redirection" context="#stay" String="\d*<<<" />
<!-- handle here document -->
<Detect2Chars attribute="Redirection" context="HereDoc" char="<" char1="<" lookAhead="true" />
<!-- handle process subst -->
<Detect2Chars attribute="Redirection" context="ProcessSubst" char="<" char1="(" />
<Detect2Chars attribute="Redirection" context="ProcessSubst" char=">" char1="(" />
<!-- handle redirection -->
<RegExpr attribute="Redirection" context="#stay" String="([0-9]*(>{1,2}|<)(&[0-9]+-?)?|&>|>&|[0-9]*<>)" />
<!-- handle &, &&, | and || -->
<RegExpr attribute="Control" context="#stay" String="([|&])\1?" />
<!-- mark function definitions without function keyword -->
<RegExpr attribute="Function" context="#stay" String="&funcname;\s*\(\)" />
</context>
<!-- FindOthers contains various rules to mark different shell input -->
<context attribute="Normal Text" lineEndContext="#stay" name="FindOthers">
<RegExpr attribute="Escape" context="#stay" String="\\[][;\\$`{}()|&<>* ]" />
<RegExpr attribute="Keyword" context="#stay" String="\\$" />
<RegExpr attribute="Escape" context="#stay" String="\{(?!(\s|$))\S*\}" />
<RegExpr attribute="Path" context="#stay" String="&pathpart;*(?=/)" />
<RegExpr attribute="Path" context="#stay" String="~\w*" />
<RegExpr attribute="Path" context="#stay" String="/&pathpart;*(?=([\s/):;$`'"]|$))" />
<!-- TODO: shell globs beside * and ? (in Path's) -->
</context>
<!-- FindStrings looks for single and double quoted strings, also with $-prefix -->
<context attribute="Normal Text" lineEndContext="#stay" name="FindStrings">
<Detect2Chars attribute="Escape" context="#stay" char="\" char1="'" />
<Detect2Chars attribute="Escape" context="#stay" char="\" char1=""" />
<DetectChar attribute="String SingleQ" context="StringSQ" char="'" />
<DetectChar attribute="String DoubleQ" context="StringDQ" char=""" />
<Detect2Chars attribute="String SingleQ" context="StringEsc" char="$" char1="'" />
<Detect2Chars attribute="String Transl." context="StringDQ" char="$" char1=""" />
</context>
<!-- FindSubstitutions goes after anything starting with $ and ` and their escapes -->
<context attribute="Normal Text" lineEndContext="#stay" name="FindSubstitutions">
<RegExpr attribute="Variable" context="Subscript" String="\$&varname;\[" />
<RegExpr attribute="Variable" context="#stay" String="\$&varname;" />
<RegExpr attribute="Variable" context="#stay" String="\$[*@#?$!_0-9-]" />
<RegExpr attribute="Variable" context="#stay" String="\$\{[*@#?$!_0-9-]\}" />
<RegExpr attribute="Variable" context="#stay" String="\$\{#&varname;(\[[*@]\])?\}" />
<RegExpr attribute="Variable" context="#stay" String="\$\{!&varname;(\[[*@]\]|[*@])?\}" />
<RegExpr attribute="Variable" context="VarBrace" String="\$\{#?&varname;" />
<RegExpr attribute="Variable" context="VarBrace" String="\$\{[*@#?$!_0-9-](?=[:#%/=?+-])" />
<StringDetect attribute="Variable" context="ExprDblParenSubst" String="$((" beginRegion="expression" />
<StringDetect attribute="Redirection" context="SubstFile" String="$(<" />
<Detect2Chars attribute="Variable" context="SubstCommand" char="$" char1="(" />
<DetectChar attribute="Backquote" context="SubstBackq" char="`" />
<RegExpr attribute="Escape" context="#stay" String="\\[`$\\]" />
</context>
<!-- FindTests finds operators valid in tests -->
<context attribute="Normal Text" lineEndContext="#stay" name="FindTests">
<RegExpr attribute="Expression" context="#stay" String="-[abcdefghkprstuwxOGLSNozn](?=\s)"/>
<RegExpr attribute="Expression" context="#stay" String="-([no]t|ef)(?=\s)"/>
<RegExpr attribute="Expression" context="#stay" String="([!=]=?|[><])(?=\s)"/>
<RegExpr attribute="Expression" context="#stay" String="-(eq|ne|[gl][te])(?=\s)"/>
</context>
<!-- ====== These are the contexts that can be branched to ======= -->
<!-- ExprDblParen consumes an expression started in command mode till )) -->
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParen">
<Detect2Chars attribute="Keyword" context="#pop" char=")" char1=")" endRegion="expression" />
<DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
<IncludeRules context="FindMost" />
</context>
<!-- ExprDblParenSubst like ExprDblParen but matches )) as Variable -->
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParenSubst">
<Detect2Chars attribute="Variable" context="#pop" char=")" char1=")" endRegion="expression" />
<DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
<IncludeRules context="FindMost" />
</context>
<!-- ExprSubParen consumes an expression till ) -->
<context attribute="Normal Text" lineEndContext="#stay" name="ExprSubParen">
<DetectChar attribute="Normal Text" context="#pop" char=")" />
<DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
<IncludeRules context="FindMost" />
</context>
<!-- ExprBracket consumes an expression till ] -->
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracket">
<RegExpr attribute="Builtin" context="#pop" String="\s\](?=($|[\s;|&]))" endRegion="expression" />
<RegExpr attribute="Builtin" context="#pop" String="\](?=($|[\s;|&]))" endRegion="expression" column="0"/>
<DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
<IncludeRules context="FindTests" />
<IncludeRules context="FindMost" />
</context>
<!-- ExprDblBracket consumes an expression till ]] -->
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracket">
<RegExpr attribute="Keyword" context="#pop" String="\s\]\](?=($|[\s;|&]))" endRegion="expression" />
<RegExpr attribute="Keyword" context="#pop" String="\]\](?=($|[\s;|&]))" endRegion="expression" column="0"/>
<DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
<IncludeRules context="FindTests" />
<IncludeRules context="FindMost" />
</context>
<!-- Group consumes shell input till } -->
<context attribute="Normal Text" lineEndContext="#stay" name="Group">
<DetectChar attribute="Keyword" context="#pop" char="}" endRegion="group" />
<IncludeRules context="FindAll" />
</context>
<!-- SubShell consumes shell input till ) -->
<context attribute="Normal Text" lineEndContext="#stay" name="SubShell">
<DetectChar attribute="Keyword" context="#pop" char=")" endRegion="subshell" />
<IncludeRules context="FindAll" />
</context>
<!-- Assign consumes an expression till EOL or whitespace -->
<context attribute="Normal Text" lineEndContext="#pop" name="Assign" fallthrough="true" fallthroughContext="#pop">
<DetectChar attribute="Variable" context="AssignArray" char="(" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
<IncludeRules context="FindOthers" />
<RegExpr attribute="Normal Text" context="#stay" String="[\w:,+_./-]" />
</context>
<!-- AssignArray consumes everything till ), marking assignments -->
<context attribute="Normal Text" lineEndContext="#pop" name="AssignArray">
<DetectChar attribute="Variable" context="#pop" char=")" />
<DetectChar attribute="Variable" context="Subscript" char="[" />
<DetectChar attribute="Variable" context="Assign" char="=" />
<IncludeRules context="FindMost" />
</context>
<!-- AssignSubscr first expects a [ then parses subscript and continues with '=value' -->
<context attribute="Normal Text" lineEndContext="#pop" name="AssignSubscr" fallthrough="true" fallthroughContext="#pop">
<DetectChar attribute="Variable" context="Subscript" char="[" />
<Detect2Chars attribute="Variable" context="Assign" char="+" char1="=" />
<DetectChar attribute="Variable" context="Assign" char="=" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
<IncludeRules context="FindOthers" />
</context>
<!-- Subscript consumes anything till ], marks as Variable -->
<context attribute="Variable" lineEndContext="#stay" name="Subscript">
<DetectChar attribute="Variable" context="#pop" char="]" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
<IncludeRules context="FindOthers" />
</context>
<!-- FunctionDef consumes a name, possibly with (), marks as Function -->
<context attribute="Function" lineEndContext="#pop" name="FunctionDef" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Function" context="#pop" String="\s+&funcname;(\s*\(\))?" />
</context>
<!-- VarName consumes spare variable names and assignments -->
<context attribute="Normal Text" lineEndContext="#pop" name="VarName" fallthrough="true" fallthroughContext="#pop">
<!-- handle command line options -->
<RegExpr attribute="Option" context="#stay" String="-[A-Za-z0-9]+" />
<RegExpr attribute="Option" context="#stay" String="--[a-z][A-Za-z0-9_-]*" />
<RegExpr attribute="Variable" context="#stay" String="\b&varname;" />
<DetectChar attribute="Variable" context="Subscript" char="[" />
<DetectChar attribute="Variable" context="Assign" char="=" />
<IncludeRules context="FindMost" />
<!-- stay here in spaces and other safe characters -->
<RegExpr attribute="Normal Text" context="#stay" String="[^]})|;`&><]" />
</context>
<!-- ProcessSubst handles <(command) and >(command) -->
<context attribute="Normal Text" lineEndContext="#stay" name="ProcessSubst">
<DetectChar attribute="Redirection" context="#pop" char=")" />
<IncludeRules context="FindCommentsParen" />
<IncludeRules context="FindCommands" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
<IncludeRules context="FindOthers" />
</context>
<!-- StringSQ consumes anything till ' -->
<context attribute="String SingleQ" lineEndContext="#stay" name="StringSQ">
<DetectChar attribute="String SingleQ" context="#pop" char="'" />
</context>
<!-- StringDQ consumes anything till ", substitutes vars and expressions -->
<context attribute="String DoubleQ" lineEndContext="#stay" name="StringDQ">
<DetectChar attribute="String DoubleQ" context="#pop" char=""" />
<RegExpr attribute="String Escape" context="#stay" String="\\[`"\\$\n]" />
<IncludeRules context="FindSubstitutions" />
</context>
<!-- StringEsc eats till ', but escaping many characters -->
<context attribute="String SingleQ" lineEndContext="#stay" name="StringEsc">
<DetectChar attribute="String SingleQ" context="#pop" char="'" />
<RegExpr attribute="String Escape" context="#stay" String="\\[abefnrtv\\']" />
<RegExpr attribute="String Escape" context="#stay" String="\\([0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)" />
</context>
<!-- VarBrace is called as soon as ${xxx is encoutered -->
<context attribute="Error" lineEndContext="#stay" name="VarBrace">
<DetectChar attribute="Variable" context="#pop" char="}" />
<DetectChar attribute="Variable" context="Subscript" char="[" />
<RegExpr attribute="Variable" context="VarAlt" String="(:?[-=?+]|##?|%%?)" />
<RegExpr attribute="Variable" context="VarSubst" String="//?" />
<DetectChar attribute="Variable" context="VarSub" char=":" />
</context>
<!-- VarAlt is to handle default/alternate/etc values of variables -->
<context attribute="Normal Text" lineEndContext="#stay" name="VarAlt">
<DetectChar attribute="Variable" context="#pop#pop" char="}" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
</context>
<!-- VarSubst is to handle substitutions on variables -->
<context attribute="Normal Text" lineEndContext="#stay" name="VarSubst">
<DetectChar attribute="Variable" context="#pop#pop" char="}" />
<DetectChar attribute="Variable" context="VarSubst2" char="/" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="VarSubst2">
<DetectChar attribute="Variable" context="#pop#pop#pop" char="}" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
</context>
<!-- VarSub is to substrings of variables -->
<context attribute="Error" lineEndContext="#stay" name="VarSub">
<DetectChar attribute="Variable" context="VarSub2" char=":" />
<DetectChar attribute="Variable" context="#pop#pop" char="}" />
<RegExpr attribute="Variable" context="#stay" String="&varname;" />
<RegExpr attribute="Variable" context="#stay" String="[0-9]+(?=[:}])" />
<IncludeRules context="FindSubstitutions" />
</context>
<context attribute="Error" lineEndContext="#stay" name="VarSub2">
<DetectChar attribute="Variable" context="#pop#pop#pop" char="}" />
<RegExpr attribute="Variable" context="#stay" String="&varname;" />
<RegExpr attribute="Variable" context="#stay" String="[0-9](?=[:}])" />
<IncludeRules context="FindSubstitutions" />
</context>
<!-- SubstFile is called after a <( or >( is encoutered -->
<context attribute="Normal Text" lineEndContext="#stay" name="SubstFile">
<DetectChar attribute="Redirection" context="#pop" char=")" />
<IncludeRules context="FindCommentsParen" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
<IncludeRules context="FindOthers" />
</context>
<!-- SubstCommand is called after a $( is encountered -->
<context attribute="Normal Text" lineEndContext="#stay" name="SubstCommand">
<DetectChar attribute="Variable" context="#pop" char=")" />
<IncludeRules context="FindCommentsParen" />
<IncludeRules context="FindCommands" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
<IncludeRules context="FindOthers" />
</context>
<!-- SubstBackq is called when a backquote is encountered -->
<context attribute="Normal Text" lineEndContext="#stay" name="SubstBackq">
<DetectChar attribute="Backquote" context="#pop" char="`" />
<IncludeRules context="FindCommentsBackq" />
<IncludeRules context="FindCommands" />
<IncludeRules context="FindStrings" />
<IncludeRules context="FindSubstitutions" />
<IncludeRules context="FindOthers" />
</context>
<!-- Case is called after the case keyword is encoutered. We handle this because of
the lonely closing parentheses that would otherwise disturb the expr matching -->
<context attribute="Normal Text" lineEndContext="#stay" name="Case">
<RegExpr attribute="Keyword" context="CaseIn" String="\sin\b" />
<IncludeRules context="FindMost" />
</context>
<!-- CaseIn is called when the construct 'case ... in' has been found. -->
<context attribute="Normal Text" lineEndContext="#stay" name="CaseIn">
<RegExpr attribute="Keyword" context="#pop#pop" String="\besac(?=$|[\s;)])" endRegion="case" />
<DetectChar attribute="Keyword" context="CaseExpr" char=")" beginRegion="caseexpr" />
<AnyChar attribute="Keyword" context="#stay" String="(|" />
<IncludeRules context="FindMost" />
</context>
<!-- CaseExpr eats shell input till ;; -->
<context attribute="Normal Text" lineEndContext="#stay" name="CaseExpr">
<Detect2Chars attribute="Keyword" context="#pop" char=";" char1=";" endRegion="caseexpr" />
<RegExpr attribute="Keyword" context="#pop" String="esac(?=$|[\s;)])" lookAhead="true" firstNonSpace="true" endRegion="caseexpr"/>
<IncludeRules context="FindAll" />
</context>
<!-- HereDoc consumes Here-documents. It is called at the beginning of the "<<" construct. -->
<context attribute="Normal Text" lineEndContext="#stay" name="HereDoc">
<RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*"(&word;)")" lookAhead="true" />
<RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*'(&word;)')" lookAhead="true" />
<RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*\\(&word;))" lookAhead="true" />
<RegExpr attribute="Redirection" context="HereDocINQ" String="(<<-\s*(&word;))" lookAhead="true" />
<RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*"(&word;)")" lookAhead="true" />
<RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*'(&word;)')" lookAhead="true" />
<RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*\\(&word;))" lookAhead="true" />
<RegExpr attribute="Redirection" context="HereDocNQ" String="(<<\s*(&word;))" lookAhead="true" />
<Detect2Chars attribute="Redirection" context="#pop" char="<" char1="<" /><!-- always met -->
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="HereDocRemainder">
<IncludeRules context="FindAll" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="HereDocQ" dynamic="true">
<StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
<RegExpr attribute="Redirection" context="#pop#pop" String="^%2\b" dynamic="true" column="0"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="HereDocNQ" dynamic="true">
<StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
<RegExpr attribute="Redirection" context="#pop#pop" String="^%2\b" dynamic="true" column="0"/>
<IncludeRules context="FindSubstitutions" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="HereDocIQ" dynamic="true">
<StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
<RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%2\b" dynamic="true" column="0"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="HereDocINQ" dynamic="true">
<StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
<RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%2\b" dynamic="true" column="0"/>
<IncludeRules context="FindSubstitutions" />
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" />
<itemData name="Comment" defStyleNum="dsComment" />
<itemData name="Keyword" defStyleNum="dsKeyword" />
<itemData name="Control" defStyleNum="dsKeyword" />
<itemData name="Builtin" defStyleNum="dsKeyword" color="#808" />
<itemData name="Command" defStyleNum="dsKeyword" color="#c0c" />
<itemData name="Redirection" defStyleNum="dsKeyword" color="#238" />
<itemData name="Escape" defStyleNum="dsDataType" />
<itemData name="String SingleQ" defStyleNum="dsString" />
<itemData name="String DoubleQ" defStyleNum="dsString" />
<itemData name="Backquote" defStyleNum="dsKeyword" />
<itemData name="String Transl." defStyleNum="dsString" />
<itemData name="String Escape" defStyleNum="dsDataType" />
<itemData name="Variable" defStyleNum="dsOthers" />
<itemData name="Expression" defStyleNum="dsOthers" />
<itemData name="Function" defStyleNum="dsFunction" />
<itemData name="Path" defStyleNum="dsNormal" />
<itemData name="Option" defStyleNum="dsNormal" />
<itemData name="Error" defStyleNum="dsError" />
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="#"/>
</comments>
<keywords casesensitive="1" weakDeliminator="^%#[]$._{}:-/" additionalDeliminator="`"/>
</general>
</language>
<!-- kate: replace-tabs on; indent-width 2; -->