mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add `stateMutability field to JSON AST for address` types.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user