1<lexer>
2 <config>
3 <name>Cheetah</name>
4 <alias>cheetah</alias>
5 <alias>spitfire</alias>
6 <filename>*.tmpl</filename>
7 <filename>*.spt</filename>
8 <mime_type>application/x-cheetah</mime_type>
9 <mime_type>application/x-spitfire</mime_type>
10 </config>
11 <rules>
12 <state name="root">
13 <rule pattern="(##[^\n]*)$">
14 <bygroups>
15 <token type="Comment"/>
16 </bygroups>
17 </rule>
18 <rule pattern="#[*](.|\n)*?[*]#">
19 <token type="Comment"/>
20 </rule>
21 <rule pattern="#end[^#\n]*(?:#|$)">
22 <token type="CommentPreproc"/>
23 </rule>
24 <rule pattern="#slurp$">
25 <token type="CommentPreproc"/>
26 </rule>
27 <rule pattern="(#[a-zA-Z]+)([^#\n]*)(#|$)">
28 <bygroups>
29 <token type="CommentPreproc"/>
30 <using lexer="Python"/>
31 <token type="CommentPreproc"/>
32 </bygroups>
33 </rule>
34 <rule pattern="(\$)([a-zA-Z_][\w.]*\w)">
35 <bygroups>
36 <token type="CommentPreproc"/>
37 <using lexer="Python"/>
38 </bygroups>
39 </rule>
40 <rule pattern="(\$\{!?)(.*?)(\})(?s)">
41 <bygroups>
42 <token type="CommentPreproc"/>
43 <using lexer="Python"/>
44 <token type="CommentPreproc"/>
45 </bygroups>
46 </rule>
47 <rule pattern="(?sx)
 (.+?) # anything, followed by:
 (?:
 (?=\#[#a-zA-Z]*) | # an eval comment
 (?=\$[a-zA-Z_{]) | # a substitution
 \Z # end of string
 )
 ">
48 <token type="Other"/>
49 </rule>
50 <rule pattern="\s+">
51 <token type="Text"/>
52 </rule>
53 </state>
54 </rules>
55</lexer>