mirror of
https://github.com/cheat/cheat.git
synced 2024-11-18 09:50:39 +01:00
245 lines
6.4 KiB
XML
245 lines
6.4 KiB
XML
|
<lexer>
|
||
|
<config>
|
||
|
<name>Modula-2</name>
|
||
|
<alias>modula2</alias>
|
||
|
<alias>m2</alias>
|
||
|
<filename>*.def</filename>
|
||
|
<filename>*.mod</filename>
|
||
|
<mime_type>text/x-modula2</mime_type>
|
||
|
<dot_all>true</dot_all>
|
||
|
</config>
|
||
|
<rules>
|
||
|
<state name="dialecttags">
|
||
|
<rule pattern="\(\*!m2pim\*\)">
|
||
|
<token type="CommentSpecial"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(\*!m2iso\*\)">
|
||
|
<token type="CommentSpecial"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(\*!m2r10\*\)">
|
||
|
<token type="CommentSpecial"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(\*!objm2\*\)">
|
||
|
<token type="CommentSpecial"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(\*!m2iso\+aglet\*\)">
|
||
|
<token type="CommentSpecial"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(\*!m2pim\+gm2\*\)">
|
||
|
<token type="CommentSpecial"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(\*!m2iso\+p1\*\)">
|
||
|
<token type="CommentSpecial"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(\*!m2iso\+xds\*\)">
|
||
|
<token type="CommentSpecial"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="unigraph_operators">
|
||
|
<rule pattern="[+-]">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="[*/]">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="\\">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="[=#<>]">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="\^">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="@">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="&">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="~">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="`">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="string_literals">
|
||
|
<rule pattern="'(\\\\|\\'|[^'])*'">
|
||
|
<token type="LiteralString"/>
|
||
|
</rule>
|
||
|
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||
|
<token type="LiteralString"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="identifiers">
|
||
|
<rule pattern="([a-zA-Z_$][\w$]*)">
|
||
|
<token type="Name"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="pragmas">
|
||
|
<rule pattern="<\*.*?\*>">
|
||
|
<token type="CommentPreproc"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(\*\$.*?\*\)">
|
||
|
<token type="CommentPreproc"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="comments">
|
||
|
<rule pattern="^//.*?\n">
|
||
|
<token type="CommentSingle"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(\*([^$].*?)\*\)">
|
||
|
<token type="CommentMultiline"/>
|
||
|
</rule>
|
||
|
<rule pattern="/\*(.*?)\*/">
|
||
|
<token type="CommentMultiline"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="whitespace">
|
||
|
<rule pattern="\n+">
|
||
|
<token type="Text"/>
|
||
|
</rule>
|
||
|
<rule pattern="\s+">
|
||
|
<token type="Text"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="suffixed_number_literals">
|
||
|
<rule pattern="[0-7]+B">
|
||
|
<token type="LiteralNumberOct"/>
|
||
|
</rule>
|
||
|
<rule pattern="[0-7]+C">
|
||
|
<token type="LiteralNumberOct"/>
|
||
|
</rule>
|
||
|
<rule pattern="[0-9A-F]+H">
|
||
|
<token type="LiteralNumberHex"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="plain_number_literals">
|
||
|
<rule pattern="[0-9]+(\'[0-9]+)*\.[0-9]+(\'[0-9]+)*[eE][+-]?[0-9]+(\'[0-9]+)*">
|
||
|
<token type="LiteralNumberFloat"/>
|
||
|
</rule>
|
||
|
<rule pattern="[0-9]+(\'[0-9]+)*\.[0-9]+(\'[0-9]+)*">
|
||
|
<token type="LiteralNumberFloat"/>
|
||
|
</rule>
|
||
|
<rule pattern="[0-9]+(\'[0-9]+)*">
|
||
|
<token type="LiteralNumberInteger"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="digraph_punctuation">
|
||
|
<rule pattern="\.\.">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
<rule pattern="<<">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
<rule pattern=">>">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
<rule pattern="->">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
<rule pattern="\|#">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
<rule pattern="##">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
<rule pattern="\|\*">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="unigraph_punctuation">
|
||
|
<rule pattern="[()\[\]{},.:;|]">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
<rule pattern="!">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
<rule pattern="\?">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="root">
|
||
|
<rule>
|
||
|
<include state="whitespace"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="dialecttags"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="pragmas"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="comments"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="identifiers"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="suffixed_number_literals"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="prefixed_number_literals"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="plain_number_literals"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="string_literals"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="digraph_punctuation"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="digraph_operators"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="unigraph_punctuation"/>
|
||
|
</rule>
|
||
|
<rule>
|
||
|
<include state="unigraph_operators"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="prefixed_number_literals">
|
||
|
<rule pattern="0b[01]+(\'[01]+)*">
|
||
|
<token type="LiteralNumberBin"/>
|
||
|
</rule>
|
||
|
<rule pattern="0[ux][0-9A-F]+(\'[0-9A-F]+)*">
|
||
|
<token type="LiteralNumberHex"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="digraph_operators">
|
||
|
<rule pattern="\*\.">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="\+>">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="<>">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="<=">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern=">=">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="==">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="::">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern=":=">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="\+\+">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="--">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
</rules>
|
||
|
</lexer>
|