diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-05-08 19:08:06 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-07-03 21:31:34 +0800 |
commit | 3984beef7d389776c23053e3136ae99296c12e8e (patch) | |
tree | 3b8c9048c5cea29bba37f1e8af705e81f3186c91 /libsolidity/parsing | |
parent | 09f3532ea961198d07e9b2b54ceefd6368d74770 (diff) | |
download | dexon-solidity-3984beef7d389776c23053e3136ae99296c12e8e.tar.gz dexon-solidity-3984beef7d389776c23053e3136ae99296c12e8e.tar.zst dexon-solidity-3984beef7d389776c23053e3136ae99296c12e8e.zip |
Remove constant keyword from parser.
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index e9810fe3..e2bd6fb4 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -322,11 +322,18 @@ StateMutability Parser::parseStateMutability(Token::Value _token) StateMutability stateMutability(StateMutability::NonPayable); if (_token == Token::Payable) stateMutability = StateMutability::Payable; - // FIXME: constant should be removed at the next breaking release - else if (_token == Token::View || _token == Token::Constant) + else if (_token == Token::View) stateMutability = StateMutability::View; else if (_token == Token::Pure) stateMutability = StateMutability::Pure; + else if (_token == Token::Constant) + { + stateMutability = StateMutability::View; + parserError( + "The state mutability modifier \"constant\" was removed in version 0.5.0. " + "Use \"view\" or \"pure\" instead." + ); + } else solAssert(false, "Invalid state mutability specifier."); m_scanner->next(); |