77 lines
2.7 KiB
XML
77 lines
2.7 KiB
XML
|
<lexer>
|
||
|
<config>
|
||
|
<name>Myghty</name>
|
||
|
<alias>myghty</alias>
|
||
|
<filename>*.myt</filename>
|
||
|
<filename>autodelegate</filename>
|
||
|
<mime_type>application/x-myghty</mime_type>
|
||
|
</config>
|
||
|
<rules>
|
||
|
<state name="root">
|
||
|
<rule pattern="\s+">
|
||
|
<token type="Text"/>
|
||
|
</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="Python2"/>
|
||
|
<token type="NameTag"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(<&[^|])(.*?)(,.*?)?(&>)">
|
||
|
<bygroups>
|
||
|
<token type="NameTag"/>
|
||
|
<token type="NameFunction"/>
|
||
|
<using lexer="Python2"/>
|
||
|
<token type="NameTag"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="(<&\|)(.*?)(,.*?)?(&>)(?s)">
|
||
|
<bygroups>
|
||
|
<token type="NameTag"/>
|
||
|
<token type="NameFunction"/>
|
||
|
<using lexer="Python2"/>
|
||
|
<token type="NameTag"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
<rule pattern="</&>">
|
||
|
<token type="NameTag"/>
|
||
|
</rule>
|
||
|
<rule pattern="(<%!?)(.*?)(%>)(?s)">
|
||
|
<bygroups>
|
||
|
<token type="NameTag"/>
|
||
|
<using lexer="Python2"/>
|
||
|
<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="Python2"/>
|
||
|
<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>
|
||
|
<token type="Other"/>
|
||
|
<token type="Operator"/>
|
||
|
</bygroups>
|
||
|
</rule>
|
||
|
</state>
|
||
|
</rules>
|
||
|
</lexer>
|