aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/Compiler.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-10-09 00:01:12 +0800
committerchriseth <c@ethdev.com>2015-10-09 00:25:44 +0800
commitb9a166061bc94cd06458c945d66bf52e76e84b70 (patch)
tree9e317a5de58a050f49187a0318fff0e4981d7c98 /libsolidity/Compiler.cpp
parent23865e39295dd9199769727b037c1d126807b20e (diff)
downloaddexon-solidity-b9a166061bc94cd06458c945d66bf52e76e84b70.tar.gz
dexon-solidity-b9a166061bc94cd06458c945d66bf52e76e84b70.tar.zst
dexon-solidity-b9a166061bc94cd06458c945d66bf52e76e84b70.zip
Refactoring to allow multi-variable declarations.
Diffstat (limited to 'libsolidity/Compiler.cpp')
-rw-r--r--libsolidity/Compiler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp
index 7ce2121e..64a67a4f 100644
--- a/libsolidity/Compiler.cpp
+++ b/libsolidity/Compiler.cpp
@@ -623,10 +623,13 @@ bool Compiler::visit(VariableDeclarationStatement const& _variableDeclarationSta
{
StackHeightChecker checker(m_context);
CompilerContext::LocationSetter locationSetter(m_context, _variableDeclarationStatement);
- if (Expression const* expression = _variableDeclarationStatement.expression())
+ solAssert(_variableDeclarationStatement.declarations().size() == 1, "To be implemented.");
+ solAssert(!!_variableDeclarationStatement.declarations().front(), "");
+ VariableDeclaration const& varDecl = *_variableDeclarationStatement.declarations().front();
+ if (Expression const* expression = _variableDeclarationStatement.initialValue())
{
- compileExpression(*expression, _variableDeclarationStatement.declaration().annotation().type);
- CompilerUtils(m_context).moveToStackVariable(_variableDeclarationStatement.declaration());
+ compileExpression(*expression, varDecl.annotation().type);
+ CompilerUtils(m_context).moveToStackVariable(varDecl);
}
checker.check();
return false;