aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-04 02:32:38 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-06 05:31:22 +0800
commit8688b63fa624fbf14982c3c4340ab83c13144f66 (patch)
treeedd0b766574663cfb8e000e93a507fb78d59ba76 /libsolidity/inlineasm
parentd6396ee85fd21424568074c41a131e8c52961983 (diff)
downloaddexon-solidity-8688b63fa624fbf14982c3c4340ab83c13144f66.tar.gz
dexon-solidity-8688b63fa624fbf14982c3c4340ab83c13144f66.tar.zst
dexon-solidity-8688b63fa624fbf14982c3c4340ab83c13144f66.zip
Use boost range adaptors in AsmPrinter
Diffstat (limited to 'libsolidity/inlineasm')
-rw-r--r--libsolidity/inlineasm/AsmPrinter.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/libsolidity/inlineasm/AsmPrinter.cpp b/libsolidity/inlineasm/AsmPrinter.cpp
index 94829371..f3b66aee 100644
--- a/libsolidity/inlineasm/AsmPrinter.cpp
+++ b/libsolidity/inlineasm/AsmPrinter.cpp
@@ -119,14 +119,22 @@ string AsmPrinter::operator()(assembly::VariableDeclaration const& _variableDecl
string AsmPrinter::operator()(assembly::FunctionDefinition const& _functionDefinition)
{
string out = "function " + _functionDefinition.name + "(";
- for (auto const& argument: _functionDefinition.arguments)
- out += argument.name + appendTypeName(argument.type) + ",";
+ out += boost::algorithm::join(
+ _functionDefinition.arguments | boost::adaptors::transformed(
+ [this](TypedName argument) { return argument.name + appendTypeName(argument.type); }
+ ),
+ ", "
+ );
out += ")";
if (!_functionDefinition.returns.empty())
{
out += " -> ";
- for (auto const& argument: _functionDefinition.returns)
- out += argument.name + appendTypeName(argument.type) + ",";
+ out += boost::algorithm::join(
+ _functionDefinition.returns | boost::adaptors::transformed(
+ [this](TypedName argument) { return argument.name + appendTypeName(argument.type); }
+ ),
+ ", "
+ );
}
return out + "\n" + (*this)(_functionDefinition.body);