cheat/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cheetah.xml
Christopher Allen Lane 1790aec85d chore(deps): bump chroma to v2 #735
Bump `alecthomas/chroma` to `v2`:
https://github.com/cheat/cheat/issues/735
2023-12-13 12:54:32 -05:00

55 lines
No EOL
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)&#xA; (.+?) # anything, followed by:&#xA; (?:&#xA; (?=\#[#a-zA-Z]*) | # an eval comment&#xA; (?=\$[a-zA-Z_{]) | # a substitution&#xA; \Z # end of string&#xA; )&#xA; ">
<token type="Other"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
</state>
</rules>
</lexer>