aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/parsing/Parser.cpp')
-rw-r--r--libsolidity/parsing/Parser.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index e2e1eebc..aec9ebbb 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -592,11 +592,22 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
else if (!type)
parserError(string("Location specifier needs explicit type name."));
else
- location = (
- token == Token::Memory ?
- VariableDeclaration::Location::Memory :
- VariableDeclaration::Location::Storage
- );
+ {
+ switch (token)
+ {
+ case Token::Storage:
+ location = VariableDeclaration::Location::Storage;
+ break;
+ case Token::Memory:
+ location = VariableDeclaration::Location::Memory;
+ break;
+ case Token::CallData:
+ location = VariableDeclaration::Location::CallData;
+ break;
+ default:
+ solAssert(false, "Unknown data location.");
+ }
+ }
}
else
break;