From 3e8135613aa94a695b58acc2d85d3a79444dde24 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 28 Sep 2020 22:48:07 +0200 Subject: [PATCH] Do not export 'isStateVariable' in ast json anymore. --- Changelog.md | 1 + libsolidity/ast/ASTJsonConverter.cpp | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 037bba8fe..61d0dfa44 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,7 @@ Breaking Changes: * Type System: Unary negation can only be used on signed integers, not on unsigned integers. + * AST: Do not provide ``isStateVariable`` property for variables (can be derived from the scope). ### 0.7.3 (unreleased) diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index 34ae3c2b8..74a4edc9a 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -433,8 +433,8 @@ bool ASTJsonConverter::visit(VariableDeclaration const& _node) make_pair("name", _node.name()), make_pair("typeName", toJson(_node.typeName())), make_pair("constant", _node.isConstant()), + make_pair("documentation", toJsonOrNull(_node.documentation().get())), make_pair("mutability", VariableDeclaration::mutabilityToString(_node.mutability())), - make_pair("stateVariable", _node.isStateVariable()), make_pair("storageLocation", location(_node.referenceLocation())), make_pair("overrides", _node.overrides() ? toJson(*_node.overrides()) : Json::nullValue), make_pair("visibility", Declaration::visibilityToString(_node.visibility())), @@ -444,8 +444,6 @@ bool ASTJsonConverter::visit(VariableDeclaration const& _node) }; if (_node.isStateVariable() && _node.isPublic()) attributes.emplace_back("functionSelector", _node.externalIdentifierHex()); - if (_node.isStateVariable() && _node.documentation()) - attributes.emplace_back("documentation", toJson(*_node.documentation())); if (m_inEvent) attributes.emplace_back("indexed", _node.isIndexed()); if (!_node.annotation().baseFunctions.empty())