Adds structured docs for variable declarations.

- adds natspec generation for state variables.
- exports structured docs for state variables to JSON.
This commit is contained in:
Erik Kundt
2020-05-19 11:01:52 -05:00
committed by Alexander Arlt
parent 3e8b9bdb1c
commit 7d37ed4531
11 changed files with 128 additions and 5 deletions
+3
View File
@@ -390,7 +390,10 @@ bool ASTJsonConverter::visit(VariableDeclaration const& _node)
make_pair("typeDescriptions", typePointerToJson(_node.annotation().type, true))
};
if (_node.isStateVariable() && _node.isPublic())
{
attributes.emplace_back("functionSelector", _node.externalIdentifierHex());
attributes.emplace_back("documentation", _node.documentation() ? toJson(*_node.documentation()) : Json::nullValue);
}
if (m_inEvent)
attributes.emplace_back("indexed", _node.isIndexed());
if (!_node.annotation().baseFunctions.empty())