Refactor isConstant to add "immutable".

This commit is contained in:
chriseth
2020-03-02 14:20:17 +01:00
committed by Daniel Kirchner
parent f10c6500b2
commit 1488a1ceb8
4 changed files with 17 additions and 9 deletions
+3 -3
View File
@@ -695,7 +695,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
);
bool isIndexed = false;
bool isDeclaredConst = false;
VariableDeclaration::Constantness constantness = VariableDeclaration::Constantness::Mutable;
ASTPointer<OverrideSpecifier> overrides = nullptr;
Visibility visibility(Visibility::Default);
VariableDeclaration::Location location = VariableDeclaration::Location::Unspecified;
@@ -731,7 +731,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
if (_options.allowIndexed && token == Token::Indexed)
isIndexed = true;
else if (token == Token::Constant)
isDeclaredConst = true;
constantness = VariableDeclaration::Constantness::Constant;
else if (_options.allowLocationSpecifier && TokenTraits::isLocationSpecifier(token))
{
if (location != VariableDeclaration::Location::Unspecified)
@@ -790,7 +790,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
visibility,
_options.isStateVariable,
isIndexed,
isDeclaredConst,
constantness,
overrides,
location
);