Merge pull request #7278 from ethereum/develop

Merge develop into develop_060
This commit is contained in:
Mathias L. Baumann
2019-08-26 10:26:48 +02:00
committed by GitHub
66 changed files with 985 additions and 493 deletions
+4 -1
View File
@@ -27,6 +27,9 @@
#include <libdevcore/UTF8.h>
#include <boost/algorithm/string/join.hpp>
#include <vector>
#include <algorithm>
using namespace std;
using namespace langutil;
@@ -259,7 +262,7 @@ bool ASTJsonConverter::visit(ContractDefinition const& _node)
make_pair("fullyImplemented", _node.annotation().unimplementedFunctions.empty()),
make_pair("linearizedBaseContracts", getContainerIds(_node.annotation().linearizedBaseContracts)),
make_pair("baseContracts", toJson(_node.baseContracts())),
make_pair("contractDependencies", getContainerIds(_node.annotation().contractDependencies)),
make_pair("contractDependencies", getContainerIds(_node.annotation().contractDependencies, true)),
make_pair("nodes", toJson(_node.subNodes())),
make_pair("scope", idOrNull(_node.scope()))
});
+15 -5
View File
@@ -29,6 +29,8 @@
#include <json/json.h>
#include <ostream>
#include <stack>
#include <vector>
#include <algorithm>
namespace langutil
{
@@ -148,15 +150,23 @@ private:
return _node.id();
}
template<class Container>
static Json::Value getContainerIds(Container const& container)
static Json::Value getContainerIds(Container const& _container, bool _order = false)
{
Json::Value tmp(Json::arrayValue);
for (auto const& element: container)
std::vector<int> tmp;
for (auto const& element: _container)
{
solAssert(element, "");
tmp.append(nodeId(*element));
tmp.push_back(nodeId(*element));
}
return tmp;
if (_order)
std::sort(tmp.begin(), tmp.end());
Json::Value json(Json::arrayValue);
for (int val: tmp)
json.append(val);
return json;
}
static Json::Value typePointerToJson(TypePointer _tp, bool _short = false);
static Json::Value typePointerToJson(boost::optional<FuncCallArguments> const& _tps);