Replace superFunction by baseFunctions in AST annotations and JSON AST.

This commit is contained in:
Daniel Kirchner
2019-12-05 03:33:32 +01:00
parent 6c0660ac66
commit 8b35918ad0
5 changed files with 7 additions and 7 deletions
+2 -3
View File
@@ -106,9 +106,8 @@ struct ContractDefinitionAnnotation: TypeDeclarationAnnotation, DocumentedAnnota
struct FunctionDefinitionAnnotation: ASTAnnotation, DocumentedAnnotation
{
/// The function this function overrides, if any. This is always the closest
/// in the linearized inheritance hierarchy.
FunctionDefinition const* superFunction = nullptr;
/// The set of functions this function overrides.
std::set<FunctionDefinition const*> baseFunctions;
/// Pointer to the contract this function is defined in
ContractDefinition const* contract = nullptr;
};
+2 -1
View File
@@ -344,7 +344,6 @@ bool ASTJsonConverter::visit(FunctionDefinition const& _node)
make_pair("documentation", _node.documentation() ? Json::Value(*_node.documentation()) : Json::nullValue),
make_pair("kind", TokenTraits::toString(_node.kind())),
make_pair("stateMutability", stateMutabilityToString(_node.stateMutability())),
make_pair("superFunction", idOrNull(_node.annotation().superFunction)),
make_pair("visibility", Declaration::visibilityToString(_node.visibility())),
make_pair("overrides", _node.overrides() ? toJson(_node.overrides()->overrides()) : Json::nullValue),
make_pair("parameters", toJson(_node.parameterList())),
@@ -354,6 +353,8 @@ bool ASTJsonConverter::visit(FunctionDefinition const& _node)
make_pair("implemented", _node.isImplemented()),
make_pair("scope", idOrNull(_node.scope()))
};
if (!_node.annotation().baseFunctions.empty())
attributes.emplace_back(make_pair("baseFunctions", getContainerIds(_node.annotation().baseFunctions, true)));
if (m_legacy)
attributes.emplace_back("isConstructor", _node.isConstructor());
setJsonNode(_node, "FunctionDefinition", std::move(attributes));