diff options
author | chriseth <chris@ethereum.org> | 2018-10-09 03:47:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-09 03:47:27 +0800 |
commit | 7ff9a27979a53a0b844db2dda12a54ee4a68cf5e (patch) | |
tree | 5bdb5c3e251f920deec86362b707a7a3702c21e1 /libsolidity/ast/ASTJsonConverter.cpp | |
parent | 7d2dc14304e2ce1805069eef57904805ed6b96eb (diff) | |
parent | a434896458656249113c7e269d8fde64b3df5d69 (diff) | |
download | dexon-solidity-7ff9a27979a53a0b844db2dda12a54ee4a68cf5e.tar.gz dexon-solidity-7ff9a27979a53a0b844db2dda12a54ee4a68cf5e.tar.zst dexon-solidity-7ff9a27979a53a0b844db2dda12a54ee4a68cf5e.zip |
Merge pull request #4734 from ethereum/astUpdate
JSON AST: replace ``isConstructor`` by ``kind`` which also supports fallbacks
Diffstat (limited to 'libsolidity/ast/ASTJsonConverter.cpp')
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index cadc5f28..4b282d85 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -325,17 +325,19 @@ bool ASTJsonConverter::visit(FunctionDefinition const& _node) std::vector<pair<string, Json::Value>> attributes = { make_pair("name", _node.name()), make_pair("documentation", _node.documentation() ? Json::Value(*_node.documentation()) : Json::nullValue), + make_pair("kind", _node.isConstructor() ? "constructor" : (_node.isFallback() ? "fallback" : "function")), make_pair("stateMutability", stateMutabilityToString(_node.stateMutability())), make_pair("superFunction", idOrNull(_node.annotation().superFunction)), make_pair("visibility", Declaration::visibilityToString(_node.visibility())), make_pair("parameters", toJson(_node.parameterList())), - make_pair("isConstructor", _node.isConstructor()), make_pair("returnParameters", toJson(*_node.returnParameterList())), make_pair("modifiers", toJson(_node.modifiers())), make_pair("body", _node.isImplemented() ? toJson(_node.body()) : Json::nullValue), make_pair("implemented", _node.isImplemented()), make_pair("scope", idOrNull(_node.scope())) }; + if (m_legacy) + attributes.emplace_back("isConstructor", _node.isConstructor()); setJsonNode(_node, "FunctionDefinition", std::move(attributes)); return false; } |