From c7ec85754a53230945bd2ea57519f4fd7f12479c Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 10 Dec 2015 17:30:23 +0100 Subject: Pygments highlighting rules for Solidity. --- docs/utils/SolidityLexer.py | 85 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 docs/utils/SolidityLexer.py (limited to 'docs/utils') diff --git a/docs/utils/SolidityLexer.py b/docs/utils/SolidityLexer.py new file mode 100644 index 00000000..d05c7b0c --- /dev/null +++ b/docs/utils/SolidityLexer.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- + +import re +import copy + +from pygments.lexer import RegexLexer, ExtendedRegexLexer, bygroups, using, \ + include, this +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Other, Punctuation, Literal + +__all__ = ['SolidityLexer'] + +class SolidityLexer(RegexLexer): + name = "Solidity" + aliases = ['sol', 'solidity'] + filenames = ['*.sol'] + mimetypes = [] + flags = re.DOTALL + tokens = { + 'commentsandwhitespace': [ + (r'\s+', Text), + (r'