mirror of
https://github.com/cheat/cheat.git
synced 2024-11-27 00:11:36 +01:00
1790aec85d
Bump `alecthomas/chroma` to `v2`: https://github.com/cheat/cheat/issues/735
82 lines
3.1 KiB
XML
82 lines
3.1 KiB
XML
<lexer>
|
|
<config>
|
|
<name>Turing</name>
|
|
<alias>turing</alias>
|
|
<filename>*.turing</filename>
|
|
<filename>*.tu</filename>
|
|
<mime_type>text/x-turing</mime_type>
|
|
</config>
|
|
<rules>
|
|
<state name="root">
|
|
<rule pattern="\n">
|
|
<token type="Text"/>
|
|
</rule>
|
|
<rule pattern="\s+">
|
|
<token type="Text"/>
|
|
</rule>
|
|
<rule pattern="\\\n">
|
|
<token type="Text"/>
|
|
</rule>
|
|
<rule pattern="%(.*?)\n">
|
|
<token type="CommentSingle"/>
|
|
</rule>
|
|
<rule pattern="/(\\\n)?[*](.|\n)*?[*](\\\n)?/">
|
|
<token type="CommentMultiline"/>
|
|
</rule>
|
|
<rule pattern="(var|fcn|function|proc|procedure|process|class|end|record|type|begin|case|loop|for|const|union|monitor|module|handler)\b">
|
|
<token type="KeywordDeclaration"/>
|
|
</rule>
|
|
<rule pattern="(all|asm|assert|bind|bits|body|break|by|cheat|checked|close|condition|decreasing|def|deferred|else|elsif|exit|export|external|flexible|fork|forward|free|get|if|implement|import|include|inherit|init|invariant|label|new|objectclass|of|opaque|open|packed|pause|pervasive|post|pre|priority|put|quit|read|register|result|seek|self|set|signal|skip|tag|tell|then|timeout|to|unchecked|unqualified|wait|when|write)\b">
|
|
<token type="Keyword"/>
|
|
</rule>
|
|
<rule pattern="(true|false)\b">
|
|
<token type="KeywordConstant"/>
|
|
</rule>
|
|
<rule pattern="(addressint|boolean|pointer|string|array|real4|real8|nat1|int8|int4|int2|nat2|nat4|nat8|int1|real|char|enum|nat|int)\b">
|
|
<token type="KeywordType"/>
|
|
</rule>
|
|
<rule pattern="\d+i">
|
|
<token type="LiteralNumber"/>
|
|
</rule>
|
|
<rule pattern="\d+\.\d*([Ee][-+]\d+)?i">
|
|
<token type="LiteralNumber"/>
|
|
</rule>
|
|
<rule pattern="\.\d+([Ee][-+]\d+)?i">
|
|
<token type="LiteralNumber"/>
|
|
</rule>
|
|
<rule pattern="\d+[Ee][-+]\d+i">
|
|
<token type="LiteralNumber"/>
|
|
</rule>
|
|
<rule pattern="\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)">
|
|
<token type="LiteralNumberFloat"/>
|
|
</rule>
|
|
<rule pattern="\.\d+([eE][+\-]?\d+)?">
|
|
<token type="LiteralNumberFloat"/>
|
|
</rule>
|
|
<rule pattern="0[0-7]+">
|
|
<token type="LiteralNumberOct"/>
|
|
</rule>
|
|
<rule pattern="0[xX][0-9a-fA-F]+">
|
|
<token type="LiteralNumberHex"/>
|
|
</rule>
|
|
<rule pattern="(0|[1-9][0-9]*)">
|
|
<token type="LiteralNumberInteger"/>
|
|
</rule>
|
|
<rule pattern="(div|mod|rem|\*\*|=|<|>|>=|<=|not=|not|and|or|xor|=>|in|shl|shr|->|~|~=|~in|&|:=|\.\.|[\^+\-*/&#])">
|
|
<token type="Operator"/>
|
|
</rule>
|
|
<rule pattern="'(\\['"\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])'">
|
|
<token type="LiteralStringChar"/>
|
|
</rule>
|
|
<rule pattern=""(\\\\|\\"|[^"])*"">
|
|
<token type="LiteralString"/>
|
|
</rule>
|
|
<rule pattern="[()\[\]{}.,:]">
|
|
<token type="Punctuation"/>
|
|
</rule>
|
|
<rule pattern="[^\W\d]\w*">
|
|
<token type="NameOther"/>
|
|
</rule>
|
|
</state>
|
|
</rules>
|
|
</lexer> |