Add `stateMutability field to JSON AST for address` types.

This commit is contained in:
Daniel Kirchner
2018-09-13 15:15:49 +02:00
parent 12aaca1645
commit ae35a58124
4 changed files with 1178 additions and 2 deletions
+7 -2
View File
@@ -394,10 +394,15 @@ bool ASTJsonConverter::visit(EventDefinition const& _node)
bool ASTJsonConverter::visit(ElementaryTypeName const& _node)
{
setJsonNode(_node, "ElementaryTypeName", {
std::vector<pair<string, Json::Value>> attributes = {
make_pair("name", _node.typeName().toString()),
make_pair("typeDescriptions", typePointerToJson(_node.annotation().type, true))
});
};
if (_node.stateMutability())
attributes.emplace_back(make_pair("stateMutability", stateMutabilityToString(*_node.stateMutability())));
setJsonNode(_node, "ElementaryTypeName", std::move(attributes));
return false;
}