mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
ASTJSonconverter stack takes objects and not pointers
This commit is contained in:
parent
bcf49095a2
commit
2eaf9ff865
@ -42,12 +42,12 @@ void ASTJsonConverter::addJsonNode(string const& _typeName,
|
|||||||
attrs[e.first] = e.second;
|
attrs[e.first] = e.second;
|
||||||
node["attributes"] = attrs;
|
node["attributes"] = attrs;
|
||||||
|
|
||||||
m_jsonNodePtrs.top()->append(node);
|
m_jsonNodePtrs.top().append(node);
|
||||||
|
|
||||||
if (_hasChildren) {
|
if (_hasChildren) {
|
||||||
Json::Value children(Json::arrayValue);
|
Json::Value children(Json::arrayValue);
|
||||||
node["children"] = children;
|
node["children"] = children;
|
||||||
m_jsonNodePtrs.push(&node["children"]);
|
m_jsonNodePtrs.push(node["children"]);
|
||||||
m_depth ++;
|
m_depth ++;
|
||||||
cout << "goDown" << endl;
|
cout << "goDown" << endl;
|
||||||
}
|
}
|
||||||
@ -62,9 +62,7 @@ ASTJsonConverter::ASTJsonConverter(ASTNode const& _ast): m_ast(&_ast), m_depth(0
|
|||||||
m_astJson["attributes"] = attrs;
|
m_astJson["attributes"] = attrs;
|
||||||
attrs["name"] = "nameoffile"; //TODO
|
attrs["name"] = "nameoffile"; //TODO
|
||||||
m_astJson["children"] = children;
|
m_astJson["children"] = children;
|
||||||
// m_jsonNodePtrs.push(&m_astJson["children"]);
|
m_jsonNodePtrs.push(m_astJson["children"]);
|
||||||
m_jsonNodePtrs.push(&m_astJson["children"]);
|
|
||||||
// m_jsonNodePtrs.push(&children);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASTJsonConverter::print(ostream& _stream)
|
void ASTJsonConverter::print(ostream& _stream)
|
||||||
|
@ -128,7 +128,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Json::Value m_astJson;
|
Json::Value m_astJson;
|
||||||
std::stack<Json::Value *> m_jsonNodePtrs;
|
std::stack<Json::Value> m_jsonNodePtrs;
|
||||||
std::string m_source;
|
std::string m_source;
|
||||||
ASTNode const* m_ast;
|
ASTNode const* m_ast;
|
||||||
int m_depth;
|
int m_depth;
|
||||||
|
Loading…
Reference in New Issue
Block a user