mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-19 14:43:05 -03:00
Initial dumb stuff
This commit is contained in:
55
lexers/cheetah.xml
Normal file
55
lexers/cheetah.xml
Normal file
@ -0,0 +1,55 @@
|
||||
<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>
|
Reference in New Issue
Block a user