aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-05-08 19:08:06 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-07-03 21:31:34 +0800
commit3984beef7d389776c23053e3136ae99296c12e8e (patch)
tree3b8c9048c5cea29bba37f1e8af705e81f3186c91
parent09f3532ea961198d07e9b2b54ceefd6368d74770 (diff)
downloaddexon-solidity-3984beef7d389776c23053e3136ae99296c12e8e.tar.gz
dexon-solidity-3984beef7d389776c23053e3136ae99296c12e8e.tar.zst
dexon-solidity-3984beef7d389776c23053e3136ae99296c12e8e.zip
Remove constant keyword from parser.
-rw-r--r--libsolidity/parsing/Parser.cpp11
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();