mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Removed null members from JSON output
This commit is contained in:
committed by
Harikrishnan Mulackal
parent
d422a406ba
commit
4a001d568e
@@ -201,7 +201,7 @@ Json::Value ASTJsonConverter::inlineAssemblyIdentifierToJson(pair<yul::Identifie
|
||||
|
||||
void ASTJsonConverter::print(ostream& _stream, ASTNode const& _node)
|
||||
{
|
||||
_stream << util::jsonPrettyPrint(toJson(_node));
|
||||
_stream << util::jsonPrettyPrint(util::removeNullMembers(toJson(_node)));
|
||||
}
|
||||
|
||||
Json::Value&& ASTJsonConverter::toJson(ASTNode const& _node)
|
||||
|
||||
@@ -884,7 +884,8 @@ ASTPointer<StructuredDocumentation> ASTJsonImporter::createDocumentation(Json::V
|
||||
|
||||
Json::Value ASTJsonImporter::member(Json::Value const& _node, string const& _name)
|
||||
{
|
||||
astAssert(_node.isMember(_name), "Node '" + _node["nodeType"].asString() + "' (id " + _node["id"].asString() + ") is missing field '" + _name + "'.");
|
||||
if (!_node.isMember(_name))
|
||||
return Json::nullValue;
|
||||
return _node[_name];
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ T AsmJsonImporter::createAsmNode(Json::Value const& _node)
|
||||
|
||||
Json::Value AsmJsonImporter::member(Json::Value const& _node, string const& _name)
|
||||
{
|
||||
astAssert(_node.isMember(_name), "Node is missing field '" + _name + "'.");
|
||||
if (!_node.isMember(_name))
|
||||
return Json::nullValue;
|
||||
return _node[_name];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user