diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index 56a7ed067..5189414cb 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -336,6 +336,8 @@ bool ASTJsonConverter::visit(FunctionDefinition const& _node) make_pair("implemented", _node.isImplemented()), make_pair("scope", idOrNull(_node.scope())) }; + if (m_legacy) + attributes.emplace_back("isConstructor", _node.isConstructor()); setJsonNode(_node, "FunctionDefinition", std::move(attributes)); return false; } diff --git a/test/libsolidity/ASTJSON/constructor_legacy.json b/test/libsolidity/ASTJSON/constructor_legacy.json index 73a58acf6..0617073e3 100644 --- a/test/libsolidity/ASTJSON/constructor_legacy.json +++ b/test/libsolidity/ASTJSON/constructor_legacy.json @@ -40,6 +40,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : true, "kind" : "constructor", "modifiers" : [ diff --git a/test/libsolidity/ASTJSON/documentation_legacy.json b/test/libsolidity/ASTJSON/documentation_legacy.json index 7c9e7e20a..0277902f8 100644 --- a/test/libsolidity/ASTJSON/documentation_legacy.json +++ b/test/libsolidity/ASTJSON/documentation_legacy.json @@ -107,6 +107,7 @@ { "documentation" : "Some comment on fn.", "implemented" : true, + "isConstructor" : false, "kind" : "function", "modifiers" : [ diff --git a/test/libsolidity/ASTJSON/fallback_legacy.json b/test/libsolidity/ASTJSON/fallback_legacy.json index 2fbd0d984..0aca3128e 100644 --- a/test/libsolidity/ASTJSON/fallback_legacy.json +++ b/test/libsolidity/ASTJSON/fallback_legacy.json @@ -40,6 +40,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "fallback", "modifiers" : [ diff --git a/test/libsolidity/ASTJSON/fallback_payable_legacy.json b/test/libsolidity/ASTJSON/fallback_payable_legacy.json index 5f041961e..7320f574a 100644 --- a/test/libsolidity/ASTJSON/fallback_payable_legacy.json +++ b/test/libsolidity/ASTJSON/fallback_payable_legacy.json @@ -40,6 +40,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "fallback", "modifiers" : [ diff --git a/test/libsolidity/ASTJSON/function_type_legacy.json b/test/libsolidity/ASTJSON/function_type_legacy.json index 6c49a92f9..72ceec81e 100644 --- a/test/libsolidity/ASTJSON/function_type_legacy.json +++ b/test/libsolidity/ASTJSON/function_type_legacy.json @@ -40,6 +40,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "function", "modifiers" : [ diff --git a/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json b/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json index f6c32855f..b53332860 100644 --- a/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json +++ b/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json @@ -40,6 +40,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "function", "modifiers" : [ diff --git a/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json b/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json index 96363141d..d3bcda561 100644 --- a/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json +++ b/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json @@ -82,6 +82,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "function", "modifiers" : [ diff --git a/test/libsolidity/ASTJSON/modifier_definition_legacy.json b/test/libsolidity/ASTJSON/modifier_definition_legacy.json index 1b384fe21..5186912c8 100644 --- a/test/libsolidity/ASTJSON/modifier_definition_legacy.json +++ b/test/libsolidity/ASTJSON/modifier_definition_legacy.json @@ -104,6 +104,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "function", "name" : "F", "scope" : 14, diff --git a/test/libsolidity/ASTJSON/modifier_invocation_legacy.json b/test/libsolidity/ASTJSON/modifier_invocation_legacy.json index 1b384fe21..5186912c8 100644 --- a/test/libsolidity/ASTJSON/modifier_invocation_legacy.json +++ b/test/libsolidity/ASTJSON/modifier_invocation_legacy.json @@ -104,6 +104,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "function", "name" : "F", "scope" : 14, diff --git a/test/libsolidity/ASTJSON/non_utf8_legacy.json b/test/libsolidity/ASTJSON/non_utf8_legacy.json index c20057e7f..df1050966 100644 --- a/test/libsolidity/ASTJSON/non_utf8_legacy.json +++ b/test/libsolidity/ASTJSON/non_utf8_legacy.json @@ -40,6 +40,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "function", "modifiers" : [ diff --git a/test/libsolidity/ASTJSON/short_type_name_legacy.json b/test/libsolidity/ASTJSON/short_type_name_legacy.json index 87b078b99..1f9b19687 100644 --- a/test/libsolidity/ASTJSON/short_type_name_legacy.json +++ b/test/libsolidity/ASTJSON/short_type_name_legacy.json @@ -40,6 +40,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "function", "modifiers" : [ diff --git a/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json b/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json index 406dc8d84..420b0f609 100644 --- a/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json +++ b/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json @@ -40,6 +40,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "function", "modifiers" : [ diff --git a/test/libsolidity/ASTJSON/source_location_legacy.json b/test/libsolidity/ASTJSON/source_location_legacy.json index ee4e98416..a65979d66 100644 --- a/test/libsolidity/ASTJSON/source_location_legacy.json +++ b/test/libsolidity/ASTJSON/source_location_legacy.json @@ -40,6 +40,7 @@ { "documentation" : null, "implemented" : true, + "isConstructor" : false, "kind" : "function", "modifiers" : [