medit/moo/mooedit/language-specs/sh.lang

293 lines
9.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<language id="sh" _name="sh" version="2.0" _section="Scripts">
<metadata>
<property name="mimetypes">text/x-shellscript;application/x-shellscript;text/x-sh</property>
<property name="globs">*.sh</property>
</metadata>
<styles>
<style id="function" name="Function" map-to="def:function"/>
<style id="comment" name="Comment" map-to="def:comment"/>
<style id="string" name="String" map-to="def:string"/>
<style id="keyword" name="Keyword" map-to="def:keyword"/>
<style id="others-3" name="Others 3"/>
<style id="others-2" name="Others 2"/>
<style id="data-type" name="Data Type" map-to="def:data-type"/>
<style id="others" name="Others"/>
</styles>
<definitions>
<context id="string" style-ref="string">
<start>"</start>
<end>"</end>
<include>
<context ref="def:escape"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="string-2" style-ref="string">
<start>'</start>
<end>'</end>
<include>
<context ref="def:escape"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="backtick-string" style-ref="function" end-at-line-end="true">
<start>`</start>
<end>`</end>
<include>
<context ref="def:escape"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="line-comment" style-ref="comment" end-at-line-end="true">
<start>#</start>
<include>
<context ref="def:escape"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="punctuator" style-ref="others">
<match>[();\|&amp;/]</match>
</context>
<context id="function" style-ref="function">
<match>\b[a-zA-Z_][a-zA-Z0-9_]+[ \t]*\(\)</match>
</context>
<context id="redirection" style-ref="others">
<keyword>&gt;&amp;+[0-9]</keyword>
<keyword>\b[0-9]+&gt;&amp;</keyword>
<keyword>\b[0-9]+&gt;&amp;+[0-9]</keyword>
<keyword>\b[0-9]+&gt;</keyword>
<keyword>&gt;&gt;</keyword>
<keyword>\b[0-9]+&gt;&gt;</keyword>
<keyword>&lt;&amp;[0-9]</keyword>
<keyword>\b[0-9]+&lt;&amp;</keyword>
<keyword>\b[0-9]+&lt;&amp;[0-9]</keyword>
<keyword>\b[0-9]+&lt;</keyword>
<keyword>&lt;&lt;+[0-9]</keyword>
<keyword>\b[0-9]+&lt;&lt;</keyword>
</context>
<context id="operator" style-ref="function">
<keyword>\-a\b</keyword>
<keyword>\-b\b</keyword>
<keyword>\-c\b</keyword>
<keyword>\-d\b</keyword>
<keyword>\-e\b</keyword>
<keyword>\-f\b</keyword>
<keyword>\-g\b</keyword>
<keyword>\-h\b</keyword>
<keyword>\-k\b</keyword>
<keyword>\-p\b</keyword>
<keyword>\-r\b</keyword>
<keyword>\-s\b</keyword>
<keyword>\-t\b</keyword>
<keyword>\-u\b</keyword>
<keyword>\-w\b</keyword>
<keyword>\-x\b</keyword>
<keyword>\-O\b</keyword>
<keyword>\-G\b</keyword>
<keyword>\-L\b</keyword>
<keyword>\-S\b</keyword>
<keyword>\-N\b</keyword>
<keyword>\-nt\b</keyword>
<keyword>\-ot\b</keyword>
<keyword>\-ef\b</keyword>
<keyword>\-o\b</keyword>
<keyword>\-z\b</keyword>
<keyword>\-n\b</keyword>
<keyword>&lt;</keyword>
<keyword>&gt;</keyword>
<keyword>\!=</keyword>
<keyword>\-eq\b</keyword>
<keyword>\-ne\b</keyword>
<keyword>\-lt\b</keyword>
<keyword>\-le\b</keyword>
<keyword>\-gt\b</keyword>
<keyword>\-ge\b</keyword>
</context>
<context id="variable1" style-ref="others-3">
<keyword>[$]+[@?*{a-zA-Z0-9_][}a-zA-Z0-9_]*</keyword>
</context>
<context id="variable2" style-ref="others-2">
<keyword>[a-zA-Z_][a-zA-Z0-9_]*\=</keyword>
</context>
<context id="built-in-command" style-ref="keyword">
<keyword>\!</keyword>
<keyword>\{</keyword>
<keyword>\}</keyword>
<keyword>\bcase\b</keyword>
<keyword>\bdo\b</keyword>
<keyword>\bdone\b</keyword>
<keyword>\belif\b</keyword>
<keyword>\belse\b</keyword>
<keyword>\belse\b</keyword>
<keyword>\besac\b</keyword>
<keyword>\bfi\b</keyword>
<keyword>\bfor\b</keyword>
<keyword>\bfunction\b</keyword>
<keyword>\bif\b</keyword>
<keyword>\bin\b</keyword>
<keyword>\bselect\b</keyword>
<keyword>\bthen\b</keyword>
<keyword>\buntil\b</keyword>
<keyword>\bwhile\b</keyword>
<keyword>\bbash\b</keyword>
<keyword>\:</keyword>
<keyword>\.</keyword>
<keyword>\[</keyword>
<keyword>\]</keyword>
<keyword>[$]+\[</keyword>
<keyword>\balias\b</keyword>
<keyword>\bbg\b</keyword>
<keyword>\bbind\b</keyword>
<keyword>\bbreak\b</keyword>
<keyword>\bbuiltin\b</keyword>
<keyword>\bcd\b</keyword>
<keyword>\bcommand\b</keyword>
<keyword>\bcompgen\b</keyword>
<keyword>\bcomplete\b</keyword>
<keyword>\bcontinue\b</keyword>
<keyword>\bdeclare\b</keyword>
<keyword>\bdirs\b</keyword>
<keyword>\bdisown\b</keyword>
<keyword>\becho\b</keyword>
<keyword>\benable\b</keyword>
<keyword>\beval\b</keyword>
<keyword>\bexec\b</keyword>
<keyword>\bexit\b</keyword>
<keyword>\bexport\b</keyword>
<keyword>\bfc\b</keyword>
<keyword>\bfg\b</keyword>
<keyword>\bgetopts\b</keyword>
<keyword>\bhash\b</keyword>
<keyword>\bhelp\b</keyword>
<keyword>\bhistory\b</keyword>
<keyword>\bjobs\b</keyword>
<keyword>\bkill\b</keyword>
<keyword>\blet\b</keyword>
<keyword>\blocal\b</keyword>
<keyword>\blogout\b</keyword>
<keyword>\bpodp\b</keyword>
<keyword>\bprintf\b</keyword>
<keyword>\bpushd\b</keyword>
<keyword>\bpwd\b</keyword>
<keyword>\bread\b</keyword>
<keyword>\breadonly\b</keyword>
<keyword>\breturn\b</keyword>
<keyword>\bset\b</keyword>
<keyword>\bshift\b</keyword>
<keyword>\bshopt\b</keyword>
<keyword>\bsource\b</keyword>
<keyword>\bsuspend\b</keyword>
<keyword>\btest\b</keyword>
<keyword>\btimes\b</keyword>
<keyword>\btrap\b</keyword>
<keyword>\btype\b</keyword>
<keyword>\btypeset\b</keyword>
<keyword>\bulimit\b</keyword>
<keyword>\bumask\b</keyword>
<keyword>\bunalias\b</keyword>
<keyword>\bunset\b</keyword>
<keyword>\bwait\b</keyword>
</context>
<context id="common-command" style-ref="others">
<prefix>\b</prefix>
<suffix>\b</suffix>
<keyword>cp</keyword>
<keyword>rm</keyword>
<keyword>mv</keyword>
<keyword>which</keyword>
<keyword>cat</keyword>
<keyword>grep</keyword>
<keyword>sed</keyword>
<keyword>awk</keyword>
<keyword>mkdir</keyword>
<keyword>rmdir</keyword>
<keyword>ls</keyword>
<keyword>ps</keyword>
<keyword>killall</keyword>
<keyword>pidof</keyword>
<keyword>diff</keyword>
<keyword>head</keyword>
<keyword>tail</keyword>
<keyword>chown</keyword>
<keyword>chmod</keyword>
<keyword>dd</keyword>
<keyword>find</keyword>
<keyword>locate</keyword>
<keyword>tar</keyword>
<keyword>gunzip</keyword>
<keyword>gzip</keyword>
<keyword>bunzip2</keyword>
<keyword>bzip2</keyword>
<keyword>zip</keyword>
<keyword>unzip</keyword>
<keyword>mount</keyword>
<keyword>umount</keyword>
<keyword>sh</keyword>
<keyword>clear</keyword>
<keyword>wget</keyword>
<keyword>date</keyword>
<keyword>dir</keyword>
<keyword>du</keyword>
<keyword>expr</keyword>
<keyword>su</keyword>
<keyword>passwd</keyword>
<keyword>man</keyword>
<keyword>info</keyword>
<keyword>id</keyword>
<keyword>ifconfig</keyword>
<keyword>gcc</keyword>
<keyword>make</keyword>
<keyword>ld</keyword>
<keyword>ln</keyword>
<keyword>lsmod</keyword>
<keyword>insmod</keyword>
<keyword>modprobe</keyword>
<keyword>less</keyword>
<keyword>more</keyword>
<keyword>patch</keyword>
<keyword>ping</keyword>
<keyword>pkg-config</keyword>
<keyword>nice</keyword>
<keyword>renice</keyword>
<keyword>file</keyword>
<keyword>sudo</keyword>
<keyword>beep</keyword>
<keyword>tempfile</keyword>
<keyword>touch</keyword>
<keyword>eject</keyword>
<keyword>uname</keyword>
<keyword>uptime</keyword>
<keyword>whoami</keyword>
<keyword>who</keyword>
<keyword>whereis</keyword>
<keyword>sleep</keyword>
<keyword>dialog</keyword>
<keyword>xdialog</keyword>
<keyword>zenity</keyword>
</context>
<context id="self" style-ref="data-type">
<match>\bself\b</match>
</context>
<context id="sh">
<include>
<context ref="def:shebang"/>
<context ref="def:escape"/>
<context ref="string"/>
<context ref="string-2"/>
<context ref="backtick-string"/>
<context ref="line-comment"/>
<context ref="punctuator"/>
<context ref="function"/>
<context ref="redirection"/>
<context ref="operator"/>
<context ref="variable1"/>
<context ref="variable2"/>
<context ref="built-in-command"/>
<context ref="common-command"/>
<context ref="self"/>
</include>
</context>
</definitions>
</language>