MCPcopy Create free account
hub / github.com/DFHack/dfhack / DFHackLexer

Class DFHackLexer

docs/sphinx_extensions/dfhack/lexer.py:11–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9from sphinx.highlighting import lexers
10
11class DFHackLexer(RegexLexer):
12 name = 'DFHack'
13 aliases = ['dfhack']
14 flags = re.IGNORECASE | re.MULTILINE
15
16 tokens = {
17 'root': [
18 (r'\#.+$', Comment.Single),
19 (r'^\[[a-z]+\]\# ', Generic.Prompt),
20 (r'.+?', Text),
21 ]
22 }
23
24def register_lexer(app):
25 lexers['dfhack'] = DFHackLexer()

Callers 1

register_lexerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected