aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-10-07 18:56:17 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-10-07 18:56:17 +0800
commit5053e153ece086ce3b5e4d9a3324a526306a1579 (patch)
tree35d0f9300ed130c805fec651d5e177a8162457d8
parentd35a4b849da427629334665cc1bb931a259adac9 (diff)
parentf3913d699620d5c47b6a9f3d0c222ddcc10df44a (diff)
downloaddexon-solidity-5053e153ece086ce3b5e4d9a3324a526306a1579.tar.gz
dexon-solidity-5053e153ece086ce3b5e4d9a3324a526306a1579.tar.zst
dexon-solidity-5053e153ece086ce3b5e4d9a3324a526306a1579.zip
Merge pull request #119 from chriseth/winfail
Fix boost error.
-rw-r--r--libsolidity/InterfaceHandler.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/libsolidity/InterfaceHandler.cpp b/libsolidity/InterfaceHandler.cpp
index d23d8264..be15ae58 100644
--- a/libsolidity/InterfaceHandler.cpp
+++ b/libsolidity/InterfaceHandler.cpp
@@ -1,8 +1,6 @@
#include <libsolidity/InterfaceHandler.h>
-#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/irange.hpp>
-#include <boost/algorithm/string/join.hpp>
#include <libsolidity/AST.h>
#include <libsolidity/CompilerStack.h>
using namespace std;
@@ -111,15 +109,16 @@ string InterfaceHandler::abiInterface(ContractDefinition const& _contractDef)
string InterfaceHandler::ABISolidityInterface(ContractDefinition const& _contractDef)
{
- using namespace boost::adaptors;
- using namespace boost::algorithm;
string ret = (_contractDef.isLibrary() ? "library " : "contract ") + _contractDef.name() + "{";
auto populateParameters = [](vector<string> const& _paramNames, vector<string> const& _paramTypes)
{
- return "(" + join(boost::irange<size_t>(0, _paramNames.size()) | transformed([&](size_t _i) {
- return _paramTypes[_i] + " " + _paramNames[_i];
- }), ",") + ")";
+ string ret = "(";
+ for (size_t i = 0; i < _paramNames.size(); ++i)
+ ret += _paramTypes[i] + " " + _paramNames[i] + ",";
+ if (ret.size() != 1)
+ ret.pop_back();
+ return ret + ")";
};
// If this is a library, include all its enum and struct types. Should be more intelligent
// in the future and check what is actually used (it might even use types from other libraries
@@ -135,10 +134,12 @@ string InterfaceHandler::ABISolidityInterface(ContractDefinition const& _contrac
}
for (auto const& enu: _contractDef.definedEnums())
{
- ret += "enum " + enu->name() + "{" +
- join(enu->members() | transformed([](ASTPointer<EnumValue> const& _value) {
- return _value->name();
- }), ",") + "}";
+ ret += "enum " + enu->name() + "{";
+ for (ASTPointer<EnumValue> const& val: enu->members())
+ ret += val->name() + ",";
+ if (ret.back() == ',')
+ ret.pop_back();
+ ret += "}";
}
}
if (_contractDef.constructor())