aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast/ASTJsonConverter.cpp
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-09-10 18:49:15 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-09-13 21:15:49 +0800
commitae35a58124852eda9a5e6bf67f9976198d2f9c0f (patch)
tree011c4521d5e6157d2bc28fb8970dbc9d82b2d2e3 /libsolidity/ast/ASTJsonConverter.cpp
parent12aaca16458861e9b622818d49a82c1a7026594e (diff)
downloaddexon-solidity-ae35a58124852eda9a5e6bf67f9976198d2f9c0f.tar.gz
dexon-solidity-ae35a58124852eda9a5e6bf67f9976198d2f9c0f.tar.zst
dexon-solidity-ae35a58124852eda9a5e6bf67f9976198d2f9c0f.zip
Add ``stateMutability`` field to JSON AST for ``address`` types.
Diffstat (limited to 'libsolidity/ast/ASTJsonConverter.cpp')
-rw-r--r--libsolidity/ast/ASTJsonConverter.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp
index beab356c..8d52851a 100644
--- a/libsolidity/ast/ASTJsonConverter.cpp
+++ b/libsolidity/ast/ASTJsonConverter.cpp
@@ -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;
}