Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libsolidity/ast/ASTJsonExporter.cpp
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR needs a changelog entry.

Original file line number Diff line number Diff line change
Expand Up @@ -1006,13 +1006,13 @@ bool ASTJsonExporter::visit(Identifier const& _node)
Json overloads = Json::array();
for (auto const& dec: _node.annotation().overloadedDeclarations)
overloads.emplace_back(nodeId(*dec));
setJsonNode(_node, "Identifier", {
std::vector<std::pair<std::string, Json>> attributes = {
std::make_pair("name", _node.name()),
std::make_pair("referencedDeclaration", idOrNull(_node.annotation().referencedDeclaration)),
std::make_pair("overloadedDeclarations", overloads),
std::make_pair("typeDescriptions", typePointerToJson(_node.annotation().type)),
std::make_pair("argumentTypes", typePointerToJson(_node.annotation().arguments))
});
};
appendExpressionAttributes(attributes, _node.annotation());
setJsonNode(_node, "Identifier", std::move(attributes));
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@
"lValueRequested": false,
"leftHandSide": {
"id": 6,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down
28 changes: 28 additions & 0 deletions test/libsolidity/ASTJSON/address_payable.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
"initialValue": {
"baseExpression": {
"id": 13,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"name": "m",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand All @@ -132,6 +136,10 @@
"id": 15,
"indexExpression": {
"id": 14,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"name": "arg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -165,6 +173,10 @@
"lValueRequested": false,
"leftHandSide": {
"id": 17,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand All @@ -179,6 +191,10 @@
"operator": "=",
"rightHandSide": {
"id": 18,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"name": "arg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -238,6 +254,10 @@
"arguments": [
{
"id": 25,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -304,6 +324,10 @@
"leftHandSide": {
"baseExpression": {
"id": 28,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"name": "m",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand All @@ -317,6 +341,10 @@
"id": 30,
"indexExpression": {
"id": 29,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@
{
"expression": {
"id": 4,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"name": "L",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -303,6 +307,10 @@
"components": [
{
"id": 10,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "free2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -356,6 +364,10 @@
{
"expression": {
"id": 14,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"name": "L",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -483,6 +495,10 @@
{
"expression": {
"id": 25,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"name": "L",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -550,6 +566,10 @@
"components": [
{
"id": 31,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "free2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -697,6 +717,10 @@
{
"expression": {
"id": 42,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"name": "L",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -764,6 +788,10 @@
"components": [
{
"id": 48,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "free2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -817,6 +845,10 @@
{
"expression": {
"id": 52,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"name": "L",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down
68 changes: 68 additions & 0 deletions test/libsolidity/ASTJSON/ast_internal_function_id_export.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@
{
"expression": {
"id": 31,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "free1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand All @@ -295,6 +299,10 @@
{
"expression": {
"id": 33,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "inr1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand All @@ -313,6 +321,10 @@
"expression": {
"expression": {
"id": 35,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"name": "L",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -384,6 +396,10 @@
"components": [
{
"id": 43,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "free2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -436,6 +452,10 @@
"components": [
{
"id": 47,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "inr2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -742,6 +762,10 @@
"expression": {
"expression": {
"id": 80,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -774,6 +798,10 @@
{
"expression": {
"id": 84,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "inr1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand All @@ -791,6 +819,10 @@
{
"expression": {
"id": 86,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "free1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand All @@ -809,6 +841,10 @@
"expression": {
"expression": {
"id": 88,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"name": "L",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -842,6 +878,10 @@
"expression": {
"expression": {
"id": 92,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"name": "L",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -914,6 +954,10 @@
{
"expression": {
"id": 100,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -981,6 +1025,10 @@
"components": [
{
"id": 106,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "inr2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -1033,6 +1081,10 @@
"components": [
{
"id": 110,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "free2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -1086,6 +1138,10 @@
{
"expression": {
"id": 114,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"name": "L",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -1154,6 +1210,10 @@
{
"expression": {
"id": 120,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"name": "L",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -1299,6 +1359,10 @@
"expression": {
"argumentTypes": [],
"id": 133,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "access",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down Expand Up @@ -1335,6 +1399,10 @@
"expression": {
"argumentTypes": [],
"id": 136,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"name": "expression",
"nodeType": "Identifier",
"overloadedDeclarations": [],
Expand Down
Loading