aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/inlineasm/AsmParser.cpp')
-rw-r--r--libsolidity/inlineasm/AsmParser.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp
index d282a30d..133f70b1 100644
--- a/libsolidity/inlineasm/AsmParser.cpp
+++ b/libsolidity/inlineasm/AsmParser.cpp
@@ -347,10 +347,15 @@ assembly::VariableDeclaration Parser::parseVariableDeclaration()
else
break;
}
- expectToken(Token::Colon);
- expectToken(Token::Assign);
- varDecl.value.reset(new Statement(parseExpression()));
- varDecl.location.end = locationOf(*varDecl.value).end;
+ if (currentToken() == Token::Colon)
+ {
+ expectToken(Token::Colon);
+ expectToken(Token::Assign);
+ varDecl.value.reset(new Statement(parseExpression()));
+ varDecl.location.end = locationOf(*varDecl.value).end;
+ }
+ else
+ varDecl.location.end = varDecl.variables.back().location.end;
return varDecl;
}