diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-24 21:13:29 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-24 21:13:34 +0800 |
commit | f646247dfb7d398255b3e2cc1aa6e25fe8424af3 (patch) | |
tree | 49ef0252dd6902d46aed69b581494984e4697c41 | |
parent | 23c791e4df32315b9f16449abaac0835be7f7fdc (diff) | |
download | dexon-solidity-f646247dfb7d398255b3e2cc1aa6e25fe8424af3.tar.gz dexon-solidity-f646247dfb7d398255b3e2cc1aa6e25fe8424af3.tar.zst dexon-solidity-f646247dfb7d398255b3e2cc1aa6e25fe8424af3.zip |
Consider pure as constant for the AST JSON (to aid static analyzers)
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index f1f6770e..c0d635f3 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -325,7 +325,7 @@ bool ASTJsonConverter::visit(FunctionDefinition const& _node) std::vector<pair<string, Json::Value>> attributes = { make_pair("name", _node.name()), // FIXME: remove with next breaking release - make_pair(m_legacy ? "constant" : "isDeclaredConst", _node.stateMutability() == StateMutability::View), + make_pair(m_legacy ? "constant" : "isDeclaredConst", _node.stateMutability() <= StateMutability::View), make_pair("payable", _node.isPayable()), make_pair("statemutability", stateMutabilityToString(_node.stateMutability())), make_pair("visibility", Declaration::visibilityToString(_node.visibility())), @@ -418,7 +418,7 @@ bool ASTJsonConverter::visit(FunctionTypeName const& _node) make_pair("visibility", Declaration::visibilityToString(_node.visibility())), make_pair("statemutability", stateMutabilityToString(_node.stateMutability())), // FIXME: remove with next breaking release - make_pair(m_legacy ? "constant" : "isDeclaredConst", _node.stateMutability() == StateMutability::View), + make_pair(m_legacy ? "constant" : "isDeclaredConst", _node.stateMutability() <= StateMutability::View), make_pair("parameterTypes", toJson(*_node.parameterTypeList())), make_pair("returnParameterTypes", toJson(*_node.returnParameterTypeList())), make_pair("typeDescriptions", typePointerToJson(_node.annotation().type)) |