mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Create children node in ASTJsonConverter when neccesary
This commit is contained in:
parent
e3f90565d8
commit
4b56829ac3
@ -91,12 +91,20 @@ void ASTJsonConverter::setJsonNode(
|
|||||||
))
|
))
|
||||||
{
|
{
|
||||||
if (e.second.isObject())
|
if (e.second.isObject())
|
||||||
|
{
|
||||||
|
if (!m_currentValue["children"].isArray())
|
||||||
|
m_currentValue["children"] = Json::arrayValue;
|
||||||
appendMove(m_currentValue["children"], std::move(e.second));
|
appendMove(m_currentValue["children"], std::move(e.second));
|
||||||
|
}
|
||||||
if (e.second.isArray())
|
if (e.second.isArray())
|
||||||
for (auto& child: e.second)
|
for (auto& child: e.second)
|
||||||
if (!child.isNull())
|
if (!child.isNull())
|
||||||
|
{
|
||||||
|
if (!m_currentValue["children"].isArray())
|
||||||
|
m_currentValue["children"] = Json::arrayValue;
|
||||||
appendMove(m_currentValue["children"], std::move(child));
|
appendMove(m_currentValue["children"], std::move(child));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (e.first == "typeDescriptions")
|
if (e.first == "typeDescriptions")
|
||||||
|
Loading…
Reference in New Issue
Block a user