aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmPrinter.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-06 01:35:40 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-23 01:45:34 +0800
commit15b4d4def23bcf0feb93c67dccc137baa59d5102 (patch)
treeb684d5e478bde7d69021fd2f2235fa569d457f40 /libsolidity/inlineasm/AsmPrinter.cpp
parent74d2e7311aed67e3bb6fcf1f0fa138bc3d304095 (diff)
downloaddexon-solidity-15b4d4def23bcf0feb93c67dccc137baa59d5102.tar.gz
dexon-solidity-15b4d4def23bcf0feb93c67dccc137baa59d5102.tar.zst
dexon-solidity-15b4d4def23bcf0feb93c67dccc137baa59d5102.zip
Support multiple variables in a variable declaration in inline assembly
Diffstat (limited to 'libsolidity/inlineasm/AsmPrinter.cpp')
-rw-r--r--libsolidity/inlineasm/AsmPrinter.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/libsolidity/inlineasm/AsmPrinter.cpp b/libsolidity/inlineasm/AsmPrinter.cpp
index 636e61b8..845aefb9 100644
--- a/libsolidity/inlineasm/AsmPrinter.cpp
+++ b/libsolidity/inlineasm/AsmPrinter.cpp
@@ -121,7 +121,21 @@ string AsmPrinter::operator()(assembly::FunctionalAssignment const& _functionalA
string AsmPrinter::operator()(assembly::VariableDeclaration const& _variableDeclaration)
{
- return "let " + _variableDeclaration.variable.name + appendTypeName(_variableDeclaration.variable.type) + " := " + boost::apply_visitor(*this, *_variableDeclaration.value);
+ string out = "let ";
+ out += boost::algorithm::join(
+ _variableDeclaration.variables | boost::adaptors::transformed(
+ [this](TypedName variable) { return variable.name + appendTypeName(variable.type); }
+ ),
+ ", "
+ );
+ out += " := ";
+ out += boost::algorithm::join(
+ _variableDeclaration.values | boost::adaptors::transformed(
+ [this](Statement statement) { return boost::apply_visitor(*this, statement); }
+ ),
+ ", "
+ );
+ return out;
}
string AsmPrinter::operator()(assembly::FunctionDefinition const& _functionDefinition)