mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Rename root AST JSON node to SourceUnit
This commit is contained in:
parent
4387d8bbe3
commit
4b9eb299d0
@ -107,7 +107,7 @@ bool ASTJsonConverter::visit(SourceUnit const&)
|
||||
{
|
||||
Json::Value children(Json::arrayValue);
|
||||
|
||||
m_astJson["name"] = "root";
|
||||
m_astJson["name"] = "SourceUnit";
|
||||
m_astJson["children"] = children;
|
||||
m_jsonNodePtrs.push(&m_astJson["children"]);
|
||||
|
||||
|
@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
map<string, unsigned> sourceIndices;
|
||||
sourceIndices["a"] = 1;
|
||||
Json::Value astJson = ASTJsonConverter(c.ast("a"), sourceIndices).json();
|
||||
BOOST_CHECK_EQUAL(astJson["name"], "root");
|
||||
BOOST_CHECK_EQUAL(astJson["name"], "SourceUnit");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(source_location)
|
||||
@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE(source_location)
|
||||
map<string, unsigned> sourceIndices;
|
||||
sourceIndices["a"] = 1;
|
||||
Json::Value astJson = ASTJsonConverter(c.ast("a"), sourceIndices).json();
|
||||
BOOST_CHECK_EQUAL(astJson["name"], "root");
|
||||
BOOST_CHECK_EQUAL(astJson["name"], "SourceUnit");
|
||||
BOOST_CHECK_EQUAL(astJson["children"][0]["name"], "ContractDefinition");
|
||||
BOOST_CHECK_EQUAL(astJson["children"][0]["children"][0]["name"], "FunctionDefinition");
|
||||
BOOST_CHECK_EQUAL(astJson["children"][0]["children"][0]["src"], "13:32:1");
|
||||
|
Loading…
Reference in New Issue
Block a user