from recommonmark.parser import CommonMarkParser
project = 'LLHD'
copyright = '2017, Fabian Schuiki'
author = 'Fabian Schuiki'
version = '0.1.0' release = '0.1.0'
master_doc = 'index'
source_suffix = ['.rst', '.md']
source_parsers = {
'.md': CommonMarkParser,
}
exclude_patterns = ['_build']
pygments_style = 'sphinx'
todo_include_todos = False
html_theme = 'sphinx_rtd_theme'
import re
from pygments.lexer import RegexLexer, words
from pygments.token import Keyword, Name, Text, Comment, Operator, Number, Punctuation, String
from sphinx.highlighting import lexers
class LLHDLexer(RegexLexer):
name = 'llhd'
filenames = ['*.llhd']
flags = re.MULTILINE
tokens = {
'root': [
(r'\n', Text),
(r'\s+', Text),
(r';.*?$', Comment.Single),
(r'[=]', Operator),
(r'[%@!]([0-9a-zA-Z_.$]|\\[0-9a-fA-F]{2})+', Name),
(r'([0-9a-zA-Z_.$]|\\[0-9a-fA-F]{2})+:', Name.Label),
(r'[ilsn][0-9]+|void|metadata|label|time|\$|\*', Keyword.Type),
(words("const type func proc entity decl call inst wait br drive probe add sub mul div cmp alloc free var sig not and or xor now ret laod store".split(), suffix=r'\b'), Keyword),
(r'[+-]?[0-9]+(\.[0-9]+)?([afpnum]?s)', Number.Time),
(r'[+-]?[0-9]+', Number.Integer),
(r'[a-zA-Z_]', Text),
(r'"[^"]*"', String),
(r'[!()\[\]{},.]', Punctuation),
]
}
lexers['llhd'] = LLHDLexer()