3
V'íc7 ã @ sb d Z ddlmZmZmZmZ ddlmZmZm Z m
Z
mZmZm
Z
mZmZ dgZG dd deZdS )zÉ
pygments.lexers.solidity
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Solidity.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é )Ú
RegexLexerÚbygroupsÚincludeÚwords) ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚ
WhitespaceÚ
SolidityLexerc - @ s: e Zd ZdZdZdgZdgZg ZdZe de dde
d fd
ee
ee
jfed d ee
jee
e
jfd
ee
jee
jfde
fedId4d4d5e
jfedJd4d4d5e
jfee
jfe d7d8efd9efd:efgd;ejfd<ejfd=ejfgd>ejfd?ejfd@ejfdAejfge de ddBeeee
fdCedDfgdEefdFefgdGZdHS )Kr z>
For Solidity source code.
.. versionadded:: 2.5
ZSolidityZsolidityz*.solz¬\b(address|bool|(?:(?:bytes|hash|int|string|uint)(?:8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?))\bÚ
whitespaceÚcommentsz\bpragma\s+solidity\bÚpragmaz\b(contract)(\s+)([a-zA-Z_]\w*)z/(\s+)((?:external|public|internal|private)\s+)?z([a-zA-Z_]\w*)z1\b(enum|event|function|struct)(\s+)([a-zA-Z_]\w*)z,\b(msg|block|tx)\.([A-Za-z_][a-zA-Z0-9_]*)\bÚblockÚbreakÚconstantÚconstructorÚcontinueÚcontractÚdoÚelseÚexternalÚfalseÚforÚfunctionÚifÚimportÚ inheritedÚinternalÚisÚlibraryÚmappingÚmemoryÚmodifierÚmsgÚnewÚpayableÚprivateÚpublicÚrequireÚreturnÚreturnsÚstructÚsuicideÚthrowÚthisÚtrueÚtxÚvarÚwhilez\b)ÚprefixÚsuffixÚ keccak256Ú constantsz[a-zA-Z_]\w*z[~!%^&*+=|?:<>/-]z
[.;{}(),\[\]]z//(\n|[\w\W]*?[^\\]\n)z/(\\\n)?[*][\w\W]*?[*](\\\n)?/z/(\\\n)?[*][\w\W]*z
("(\\"|.)*?")z
('(\\'|.)*?')z\b0[xX][0-9a-fA-F]+\bz\b\d+\bz(\^|>=|<)(\s*)(\d+\.\d+\.\d+)ú;z#popz\s+z\n)Úrootr r; r r N)%r r r r r r r r r r r r r r r! r"