aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-11-24 01:33:42 +0800
committerGitHub <noreply@github.com>2017-11-24 01:33:42 +0800
commitb8d59422d15adcbbf4e0df24c12cf03f9a584aa1 (patch)
tree024f8f2c4fee71f1d77b02246d8bfd2a09727f72
parentea18bed319c67d509992572454e382d23493c1eb (diff)
parentdcd55c5005468808607ebd92d84124c8949d9d17 (diff)
downloaddexon-solidity-b8d59422d15adcbbf4e0df24c12cf03f9a584aa1.tar.gz
dexon-solidity-b8d59422d15adcbbf4e0df24c12cf03f9a584aa1.tar.zst
dexon-solidity-b8d59422d15adcbbf4e0df24c12cf03f9a584aa1.zip
Merge pull request #3240 from ethereum/docs-lexer
Update SolidityLexer
-rw-r--r--.gitignore1
-rw-r--r--docs/utils/SolidityLexer.py10
2 files changed, 6 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 114420c9..14c227d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,6 +34,7 @@ prerelease.txt
build/
docs/_build
docs/utils/__pycache__
+docs/utils/*.pyc
# vim stuff
*.swp
diff --git a/docs/utils/SolidityLexer.py b/docs/utils/SolidityLexer.py
index a828146f..50f51cf4 100644
--- a/docs/utils/SolidityLexer.py
+++ b/docs/utils/SolidityLexer.py
@@ -56,7 +56,7 @@ class SolidityLexer(RegexLexer):
(r'[})\].]', Punctuation),
(r'(anonymous|as|assembly|break|constant|continue|do|delete|else|external|for|hex|if|'
r'indexed|internal|import|is|mapping|memory|new|payable|public|pragma|'
- r'private|return|returns|storage|super|this|throw|using|while)\b', Keyword, 'slashstartsregex'),
+ r'private|pure|return|returns|storage|super|this|throw|using|view|while)\b', Keyword, 'slashstartsregex'),
(r'(var|function|event|modifier|struct|enum|contract|library|interface)\b', Keyword.Declaration, 'slashstartsregex'),
(r'(bytes|string|address|uint|int|bool|byte|' +
'|'.join(
@@ -67,15 +67,15 @@ class SolidityLexer(RegexLexer):
['fixed%dx%d' % ((i), (j + 8)) for i in range(0, 256, 8) for j in range(0, 256 - i, 8)]
) + r')\b', Keyword.Type, 'slashstartsregex'),
(r'(wei|szabo|finney|ether|seconds|minutes|hours|days|weeks|years)\b', Keyword.Type, 'slashstartsregex'),
- (r'(abstract|after|case|catch|default|final|in|inline|interface|let|match|'
- r'null|of|pure|relocatable|static|switch|try|type|typeof|view)\b', Keyword.Reserved),
+ (r'(abstract|after|case|catch|default|final|in|inline|let|match|'
+ r'null|of|relocatable|static|switch|try|type|typeof)\b', Keyword.Reserved),
(r'(true|false)\b', Keyword.Constant),
(r'(block|msg|tx|now|suicide|selfdestruct|addmod|mulmod|sha3|keccak256|log[0-4]|'
r'sha256|ecrecover|ripemd160|assert|revert|require)', Name.Builtin),
(r'[$a-zA-Z_][a-zA-Z0-9_]*', Name.Other),
- (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
+ (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?', Number.Float),
(r'0x[0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+', Number.Integer),
+ (r'[0-9]+([eE][0-9]+)?', Number.Integer),
(r'"(\\\\|\\"|[^"])*"', String.Double),
(r"'(\\\\|\\'|[^'])*'", String.Single),
]