diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index b4fc0599e..56a6289b4 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -2156,9 +2156,15 @@ public: ASTPointer _expression, std::vector> _arguments, std::vector> _names, - std::vector _nameLocations + std::vector _nameLocations, + bool _isSuffixCall = false ): - Expression(_id, _location), m_expression(std::move(_expression)), m_arguments(std::move(_arguments)), m_names(std::move(_names)), m_nameLocations(std::move(_nameLocations)) + Expression(_id, _location), + m_expression(std::move(_expression)), + m_arguments(std::move(_arguments)), + m_names(std::move(_names)), + m_nameLocations(std::move(_nameLocations)), + m_isSuffixCall(_isSuffixCall) { solAssert(m_nameLocations.size() == m_names.size()); } @@ -2176,6 +2182,7 @@ public: /// If this is not a named call, this is empty. std::vector> const& names() const { return m_names; } std::vector const& nameLocations() const { return m_nameLocations; } + bool isSuffixCall() const { return m_isSuffixCall; } FunctionCallAnnotation& annotation() const override; @@ -2184,6 +2191,7 @@ private: std::vector> m_arguments; std::vector> m_names; std::vector m_nameLocations; + bool m_isSuffixCall; }; /** diff --git a/libsolidity/ast/ASTJsonExporter.cpp b/libsolidity/ast/ASTJsonExporter.cpp index d8810ae6b..244440816 100644 --- a/libsolidity/ast/ASTJsonExporter.cpp +++ b/libsolidity/ast/ASTJsonExporter.cpp @@ -878,7 +878,8 @@ bool ASTJsonExporter::visit(FunctionCall const& _node) make_pair("names", std::move(names)), make_pair("nameLocations", sourceLocationsToJson(_node.nameLocations())), make_pair("arguments", toJson(_node.arguments())), - make_pair("tryCall", _node.annotation().tryCall) + make_pair("tryCall", _node.annotation().tryCall), + make_pair("isSuffixCall", _node.isSuffixCall()) }; if (_node.annotation().kind.set()) diff --git a/libsolidity/ast/ASTJsonImporter.cpp b/libsolidity/ast/ASTJsonImporter.cpp index 9d9e795f0..5d7f2dd92 100644 --- a/libsolidity/ast/ASTJsonImporter.cpp +++ b/libsolidity/ast/ASTJsonImporter.cpp @@ -965,7 +965,8 @@ ASTPointer ASTJsonImporter::createFunctionCall(Json::Value const& names, sourceLocations ? *sourceLocations : - vector(names.size()) + vector(names.size()), + memberAsBool(_node, "isSuffixCall") ); } diff --git a/test/libsolidity/ASTJSON/address_payable.json b/test/libsolidity/ASTJSON/address_payable.json index b39570f60..6935216a6 100644 --- a/test/libsolidity/ASTJSON/address_payable.json +++ b/test/libsolidity/ASTJSON/address_payable.json @@ -322,6 +322,7 @@ "isConstant": false, "isLValue": false, "isPure": false, + "isSuffixCall": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], @@ -448,6 +449,7 @@ "isConstant": false, "isLValue": false, "isPure": true, + "isSuffixCall": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], diff --git a/test/libsolidity/ASTJSON/address_payable_parseOnly.json b/test/libsolidity/ASTJSON/address_payable_parseOnly.json index cbdd24d7f..4472ef24c 100644 --- a/test/libsolidity/ASTJSON/address_payable_parseOnly.json +++ b/test/libsolidity/ASTJSON/address_payable_parseOnly.json @@ -214,6 +214,7 @@ } }, "id": 26, + "isSuffixCall": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", @@ -286,6 +287,7 @@ } }, "id": 34, + "isSuffixCall": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", diff --git a/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json b/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json index cceb09df9..ccc708b12 100644 --- a/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json +++ b/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json @@ -150,6 +150,7 @@ "typeDescriptions": {} }, "id": 18, + "isSuffixCall": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", diff --git a/test/libsolidity/ASTJSON/non_utf8.json b/test/libsolidity/ASTJSON/non_utf8.json index ff83dcbae..cf83214dc 100644 --- a/test/libsolidity/ASTJSON/non_utf8.json +++ b/test/libsolidity/ASTJSON/non_utf8.json @@ -133,6 +133,7 @@ "isConstant": false, "isLValue": false, "isPure": true, + "isSuffixCall": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], @@ -181,6 +182,7 @@ "isConstant": false, "isLValue": false, "isPure": true, + "isSuffixCall": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], diff --git a/test/libsolidity/ASTJSON/non_utf8_parseOnly.json b/test/libsolidity/ASTJSON/non_utf8_parseOnly.json index 1ea329f30..f36e05a74 100644 --- a/test/libsolidity/ASTJSON/non_utf8_parseOnly.json +++ b/test/libsolidity/ASTJSON/non_utf8_parseOnly.json @@ -85,6 +85,7 @@ } }, "id": 10, + "isSuffixCall": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", @@ -109,6 +110,7 @@ } }, "id": 11, + "isSuffixCall": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", diff --git a/test/libsolidity/ASTJSON/used_errors.json b/test/libsolidity/ASTJSON/used_errors.json index 7b44f8f82..cd55ed350 100644 --- a/test/libsolidity/ASTJSON/used_errors.json +++ b/test/libsolidity/ASTJSON/used_errors.json @@ -65,6 +65,7 @@ "isConstant": false, "isLValue": false, "isPure": false, + "isSuffixCall": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], @@ -175,6 +176,7 @@ "isConstant": false, "isLValue": false, "isPure": false, + "isSuffixCall": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], diff --git a/test/libsolidity/ASTJSON/used_errors_parseOnly.json b/test/libsolidity/ASTJSON/used_errors_parseOnly.json index 24d633636..f1d5866f4 100644 --- a/test/libsolidity/ASTJSON/used_errors_parseOnly.json +++ b/test/libsolidity/ASTJSON/used_errors_parseOnly.json @@ -40,6 +40,7 @@ "typeDescriptions": {} }, "id": 6, + "isSuffixCall": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", @@ -127,6 +128,7 @@ "typeDescriptions": {} }, "id": 15, + "isSuffixCall": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall",