mirror of
https://github.com/cheat/cheat.git
synced 2024-12-25 14:09:44 +01:00
1790aec85d
Bump `alecthomas/chroma` to `v2`: https://github.com/cheat/cheat/issues/735
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> |