Removed specialized errors related to constant state mutability

This commit is contained in:
Harikrishnan Mulackal
2020-07-14 12:42:47 +05:30
parent fd81885316
commit f73b25bb78
4 changed files with 7 additions and 20 deletions
+2 -10
View File
@@ -464,14 +464,6 @@ StateMutability Parser::parseStateMutability()
case Token::Pure:
stateMutability = StateMutability::Pure;
break;
case Token::Constant:
stateMutability = StateMutability::View;
parserError(
7698_error,
"The state mutability modifier \"constant\" was removed in version 0.5.0. "
"Use \"view\" or \"pure\" instead."
);
break;
default:
solAssert(false, "Invalid state mutability specifier.");
}
@@ -997,7 +989,7 @@ ASTPointer<TypeName> Parser::parseTypeName(bool _allowVar)
auto stateMutability = elemTypeName.token() == Token::Address
? optional<StateMutability>{StateMutability::NonPayable}
: nullopt;
if (TokenTraits::isStateMutabilitySpecifier(m_scanner->currentToken(), false))
if (TokenTraits::isStateMutabilitySpecifier(m_scanner->currentToken()))
{
if (elemTypeName.token() == Token::Address)
{
@@ -2065,7 +2057,7 @@ Parser::LookAheadInfo Parser::peekStatementType() const
// kind of statement. This means, for example, that we do not allow type expressions of the form
// ``address payable;``.
// If we want to change this in the future, we need to consider another scanner token here.
if (TokenTraits::isElementaryTypeName(token) && TokenTraits::isStateMutabilitySpecifier(next, false))
if (TokenTraits::isElementaryTypeName(token) && TokenTraits::isStateMutabilitySpecifier(next))
return LookAheadInfo::VariableDeclaration;
if (next == Token::Identifier || TokenTraits::isLocationSpecifier(next))
return LookAheadInfo::VariableDeclaration;