mirror of
https://github.com/cheat/cheat.git
synced 2024-11-27 00:11:36 +01:00
79 lines
2.2 KiB
XML
79 lines
2.2 KiB
XML
|
<lexer>
|
||
|
<config>
|
||
|
<name>Smarty</name>
|
||
|
<alias>smarty</alias>
|
||
|
<filename>*.tpl</filename>
|
||
|
<mime_type>application/x-smarty</mime_type>
|
||
|
<dot_all>true</dot_all>
|
||
|
</config>
|
||
|
<rules>
|
||
|
<state name="root">
|
||
|
<rule pattern="[^{]+">
|
||
|
<token type="Other"/>
|
||
|
</rule>
|
||
|
<rule pattern="(\{)(\*.*?\*)(\})">
|
||
|
<bygroups>
|
||
|
<token type="CommentPreproc"/>
|
||
|
<token type="Comment"/>
|
||
|
<token type="CommentPreproc"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(\{php\})(.*?)(\{/php\})">
|
||
|
<bygroups>
|
||
|
<token type="CommentPreproc"/>
|
||
|
<using lexer="PHP"/>
|
||
|
<token type="CommentPreproc"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(\{)(/?[a-zA-Z_]\w*)(\s*)">
|
||
|
<bygroups>
|
||
|
<token type="CommentPreproc"/>
|
||
|
<token type="NameFunction"/>
|
||
|
<token type="Text"/>
|
||
|
</bygroups>
|
||
|
<push state="smarty"/>
|
||
|
</rule>
|
||
|
<rule pattern="\{">
|
||
|
<token type="CommentPreproc"/>
|
||
|
<push state="smarty"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="smarty">
|
||
|
<rule pattern="\s+">
|
||
|
<token type="Text"/>
|
||
|
</rule>
|
||
|
<rule pattern="\{">
|
||
|
<token type="CommentPreproc"/>
|
||
|
<push/>
|
||
|
</rule>
|
||
|
<rule pattern="\}">
|
||
|
<token type="CommentPreproc"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="#[a-zA-Z_]\w*#">
|
||
|
<token type="NameVariable"/>
|
||
|
</rule>
|
||
|
<rule pattern="\$[a-zA-Z_]\w*(\.\w+)*">
|
||
|
<token type="NameVariable"/>
|
||
|
</rule>
|
||
|
<rule pattern="[~!%^&*()+=|\[\]:;,.<>/?@-]">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="(true|false|null)\b">
|
||
|
<token type="KeywordConstant"/>
|
||
|
</rule>
|
||
|
<rule pattern="[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?">
|
||
|
<token type="LiteralNumber"/>
|
||
|
</rule>
|
||
|
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||
|
<token type="LiteralStringDouble"/>
|
||
|
</rule>
|
||
|
<rule pattern="'(\\\\|\\'|[^'])*'">
|
||
|
<token type="LiteralStringSingle"/>
|
||
|
</rule>
|
||
|
<rule pattern="[a-zA-Z_]\w*">
|
||
|
<token type="NameAttribute"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
</rules>
|
||
|
</lexer>
|