mirror of
https://github.com/cheat/cheat.git
synced 2024-12-19 03:05:06 +01:00
55 lines
1.7 KiB
XML
55 lines
1.7 KiB
XML
|
<lexer>
|
||
|
<config>
|
||
|
<name>Cheetah</name>
|
||
|
<alias>cheetah</alias>
|
||
|
<alias>spitfire</alias>
|
||
|
<filename>*.tmpl</filename>
|
||
|
<filename>*.spt</filename>
|
||
|
<mime_type>application/x-cheetah</mime_type>
|
||
|
<mime_type>application/x-spitfire</mime_type>
|
||
|
</config>
|
||
|
<rules>
|
||
|
<state name="root">
|
||
|
<rule pattern="(##[^\n]*)$">
|
||
|
<bygroups>
|
||
|
<token type="Comment"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="#[*](.|\n)*?[*]#">
|
||
|
<token type="Comment"/>
|
||
|
</rule>
|
||
|
<rule pattern="#end[^#\n]*(?:#|$)">
|
||
|
<token type="CommentPreproc"/>
|
||
|
</rule>
|
||
|
<rule pattern="#slurp$">
|
||
|
<token type="CommentPreproc"/>
|
||
|
</rule>
|
||
|
<rule pattern="(#[a-zA-Z]+)([^#\n]*)(#|$)">
|
||
|
<bygroups>
|
||
|
<token type="CommentPreproc"/>
|
||
|
<using lexer="Python"/>
|
||
|
<token type="CommentPreproc"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(\$)([a-zA-Z_][\w.]*\w)">
|
||
|
<bygroups>
|
||
|
<token type="CommentPreproc"/>
|
||
|
<using lexer="Python"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(\$\{!?)(.*?)(\})(?s)">
|
||
|
<bygroups>
|
||
|
<token type="CommentPreproc"/>
|
||
|
<using lexer="Python"/>
|
||
|
<token type="CommentPreproc"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(?sx)
 (.+?) # anything, followed by:
 (?:
 (?=\#[#a-zA-Z]*) | # an eval comment
 (?=\$[a-zA-Z_{]) | # a substitution
 \Z # end of string
 )
 ">
|
||
|
<token type="Other"/>
|
||
|
</rule>
|
||
|
<rule pattern="\s+">
|
||
|
<token type="Text"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
</rules>
|
||
|
</lexer>
|