Skip to content

Commit d4da4ef

Browse files
authored
Merge pull request argotorg#1684 from federicobond/sphinx-highlight
Update the sphinx highlighting rules
2 parents 8357bda + 75d59b1 commit d4da4ef

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

docs/utils/SolidityLexer.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@ class SolidityLexer(RegexLexer):
5454
r'(<<|>>>?|==?|!=?|[-<>+*%&\|\^/])=?', Operator, 'slashstartsregex'),
5555
(r'[{(\[;,]', Punctuation, 'slashstartsregex'),
5656
(r'[})\].]', Punctuation),
57-
(r'(for|in|while|do|break|return|continue|switch|case|default|if|else|'
58-
r'throw|try|catch|finally|new|delete|typeof|instanceof|void|'
59-
r'this|import|mapping|returns|private|public|external|internal|'
60-
r'constant|memory|storage|payable)\b', Keyword, 'slashstartsregex'),
61-
(r'(var|let|with|function|event|modifier|struct|enum|contract|library)\b', Keyword.Declaration, 'slashstartsregex'),
57+
(r'(anonymous|as|assembly|break|constant|continue|do|else|external|hex|if|'
58+
r'indexed|internal|import|is|mapping|memory|new|payable|public|pragma|'
59+
r'private|return|returns|storage|super|this|throw|using|while)\b', Keyword, 'slashstartsregex'),
60+
(r'(var|function|event|modifier|struct|enum|contract|library)\b', Keyword.Declaration, 'slashstartsregex'),
6261
(r'(bytes|string|address|uint|int|bool|byte|' +
6362
'|'.join(
6463
['uint%d' % (i + 8) for i in range(0, 256, 8)] +
@@ -68,16 +67,11 @@ class SolidityLexer(RegexLexer):
6867
['fixed%dx%d' % ((i), (j + 8)) for i in range(0, 256, 8) for j in range(0, 256 - i, 8)]
6968
) + r')\b', Keyword.Type, 'slashstartsregex'),
7069
(r'(wei|szabo|finney|ether|seconds|minutes|hours|days|weeks|years)\b', Keyword.Type, 'slashstartsregex'),
71-
(r'(abstract|boolean|byte|char|class|const|debugger|double|enum|export|'
72-
r'extends|final|float|goto|implements|int|interface|long|native|'
73-
r'package|private|protected|public|short|static|super|synchronized|throws|'
74-
r'transient|volatile)\b', Keyword.Reserved),
75-
(r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
76-
(r'(Array|Boolean|Date|Error|Function|Math|netscape|'
77-
r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
78-
r'decodeURIComponent|encodeURI|encodeURIComponent|'
79-
r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|'
80-
r'window)\b', Name.Builtin),
70+
(r'(abstract|after|case|catch|default|final|in|inline|interface|let|match|'
71+
r'null|of|pure|relocatable|static|switch|try|type|typeof|view)\b', Keyword.Reserved),
72+
(r'(true|false)\b', Keyword.Constant),
73+
(r'(block|msg|tx|now|suicide|selfdestruct|addmod|mulmod|sha3|keccak256|log[0-4]|'
74+
r'sha256|ecrecover|ripemd160|assert|revert)', Name.Builtin),
8175
(r'[$a-zA-Z_][a-zA-Z0-9_]*', Name.Other),
8276
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
8377
(r'0x[0-9a-fA-F]+', Number.Hex),

0 commit comments

Comments
 (0)