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
69 lines
1.9 KiB
XML
69 lines
1.9 KiB
XML
<lexer>
|
|
<config>
|
|
<name>TableGen</name>
|
|
<alias>tablegen</alias>
|
|
<filename>*.td</filename>
|
|
<mime_type>text/x-tablegen</mime_type>
|
|
</config>
|
|
<rules>
|
|
<state name="whitespace">
|
|
<rule pattern="(\n|\s)+">
|
|
<token type="Text"/>
|
|
</rule>
|
|
<rule pattern="//.*?\n">
|
|
<token type="Comment"/>
|
|
</rule>
|
|
</state>
|
|
<state name="keyword">
|
|
<rule pattern="(multiclass|foreach|string|class|field|defm|bits|code|list|def|int|let|dag|bit|in)\b">
|
|
<token type="Keyword"/>
|
|
</rule>
|
|
</state>
|
|
<state name="root">
|
|
<rule>
|
|
<include state="macro"/>
|
|
</rule>
|
|
<rule>
|
|
<include state="whitespace"/>
|
|
</rule>
|
|
<rule pattern="c?"[^"]*?"">
|
|
<token type="LiteralString"/>
|
|
</rule>
|
|
<rule>
|
|
<include state="keyword"/>
|
|
</rule>
|
|
<rule pattern="\$[_a-zA-Z][_\w]*">
|
|
<token type="NameVariable"/>
|
|
</rule>
|
|
<rule pattern="\d*[_a-zA-Z][_\w]*">
|
|
<token type="NameVariable"/>
|
|
</rule>
|
|
<rule pattern="\[\{[\w\W]*?\}\]">
|
|
<token type="LiteralString"/>
|
|
</rule>
|
|
<rule pattern="[+-]?\d+|0x[\da-fA-F]+|0b[01]+">
|
|
<token type="LiteralNumber"/>
|
|
</rule>
|
|
<rule pattern="[=<>{}\[\]()*.,!:;]">
|
|
<token type="Punctuation"/>
|
|
</rule>
|
|
</state>
|
|
<state name="macro">
|
|
<rule pattern="(#include\s+)("[^"]*")">
|
|
<bygroups>
|
|
<token type="CommentPreproc"/>
|
|
<token type="LiteralString"/>
|
|
</bygroups>
|
|
</rule>
|
|
<rule pattern="^\s*#(ifdef|ifndef)\s+[_\w][_\w\d]*">
|
|
<token type="CommentPreproc"/>
|
|
</rule>
|
|
<rule pattern="^\s*#define\s+[_\w][_\w\d]*">
|
|
<token type="CommentPreproc"/>
|
|
</rule>
|
|
<rule pattern="^\s*#endif">
|
|
<token type="CommentPreproc"/>
|
|
</rule>
|
|
</state>
|
|
</rules>
|
|
</lexer> |