mirror of
https://github.com/cheat/cheat.git
synced 2024-11-30 09:46:53 +01:00
89 lines
3.0 KiB
XML
89 lines
3.0 KiB
XML
|
<lexer>
|
||
|
<config>
|
||
|
<name>Mason</name>
|
||
|
<alias>mason</alias>
|
||
|
<filename>*.m</filename>
|
||
|
<filename>*.mhtml</filename>
|
||
|
<filename>*.mc</filename>
|
||
|
<filename>*.mi</filename>
|
||
|
<filename>autohandler</filename>
|
||
|
<filename>dhandler</filename>
|
||
|
<mime_type>application/x-mason</mime_type>
|
||
|
<priority>0.1</priority>
|
||
|
</config>
|
||
|
<rules>
|
||
|
<state name="root">
|
||
|
<rule pattern="\s+">
|
||
|
<token type="Text"/>
|
||
|
</rule>
|
||
|
<rule pattern="(<%doc>)(.*?)(</%doc>)(?s)">
|
||
|
<bygroups>
|
||
|
<token type="NameTag"/>
|
||
|
<token type="CommentMultiline"/>
|
||
|
<token type="NameTag"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)">
|
||
|
<bygroups>
|
||
|
<token type="NameTag"/>
|
||
|
<token type="Text"/>
|
||
|
<token type="NameFunction"/>
|
||
|
<token type="NameTag"/>
|
||
|
<usingself state="root"/>
|
||
|
<token type="NameTag"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)(?s)">
|
||
|
<bygroups>
|
||
|
<token type="NameTag"/>
|
||
|
<token type="NameFunction"/>
|
||
|
<token type="NameTag"/>
|
||
|
<using lexer="Perl"/>
|
||
|
<token type="NameTag"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(<&[^|])(.*?)(,.*?)?(&>)(?s)">
|
||
|
<bygroups>
|
||
|
<token type="NameTag"/>
|
||
|
<token type="NameFunction"/>
|
||
|
<using lexer="Perl"/>
|
||
|
<token type="NameTag"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(<&\|)(.*?)(,.*?)?(&>)(?s)">
|
||
|
<bygroups>
|
||
|
<token type="NameTag"/>
|
||
|
<token type="NameFunction"/>
|
||
|
<using lexer="Perl"/>
|
||
|
<token type="NameTag"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="</&>">
|
||
|
<token type="NameTag"/>
|
||
|
</rule>
|
||
|
<rule pattern="(<%!?)(.*?)(%>)(?s)">
|
||
|
<bygroups>
|
||
|
<token type="NameTag"/>
|
||
|
<using lexer="Perl"/>
|
||
|
<token type="NameTag"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(?<=^)#[^\n]*(\n|\Z)">
|
||
|
<token type="Comment"/>
|
||
|
</rule>
|
||
|
<rule pattern="(?<=^)(%)([^\n]*)(\n|\Z)">
|
||
|
<bygroups>
|
||
|
<token type="NameTag"/>
|
||
|
<using lexer="Perl"/>
|
||
|
<token type="Other"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(?sx)
 (.+?) # anything, followed by:
 (?:
 (?<=\n)(?=[%#]) | # an eval or comment line
 (?=</?[%&]) | # a substitution or block or
 # call start or end
 # - don't consume
 (\\\n) | # an escaped newline
 \Z # end of string
 )">
|
||
|
<bygroups>
|
||
|
<using lexer="HTML"/>
|
||
|
<token type="Operator"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
</state>
|
||
|
</rules>
|
||
|
</lexer>
|