aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast/ASTJsonConverter.cpp
diff options
context:
space:
mode:
authordjudjuu <julfaber@gmail.com>2017-05-17 21:52:45 +0800
committerdjudjuu <julfaber@gmail.com>2017-05-17 21:58:28 +0800
commite3583d04f79c5e9ada9914f43711d3b90242dfdc (patch)
treeb2c8c5caa831a90beb83a1e309fd5bf6e813267c /libsolidity/ast/ASTJsonConverter.cpp
parenta4ba5ace8a5d77397715204fe737b0dba4429368 (diff)
downloaddexon-solidity-e3583d04f79c5e9ada9914f43711d3b90242dfdc.tar.gz
dexon-solidity-e3583d04f79c5e9ada9914f43711d3b90242dfdc.tar.zst
dexon-solidity-e3583d04f79c5e9ada9914f43711d3b90242dfdc.zip
include new InlineAssemblyInformation into JSON
Diffstat (limited to 'libsolidity/ast/ASTJsonConverter.cpp')
-rw-r--r--libsolidity/ast/ASTJsonConverter.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp
index 492429d7..3c3ceae8 100644
--- a/libsolidity/ast/ASTJsonConverter.cpp
+++ b/libsolidity/ast/ASTJsonConverter.cpp
@@ -171,6 +171,16 @@ void ASTJsonConverter::appendExpressionAttributes(
_attributes.insert(_attributes.end(), exprAttributes.begin(), exprAttributes.end());
}
+Json::Value ASTJsonConverter::inlineAssemblyIdentifierToJson(pair<assembly::Identifier const* ,InlineAssemblyAnnotation::ExternalIdentifierInfo> _info)
+{
+ Json::Value tuple(Json::objectValue);
+ tuple["src"] = sourceLocationToString(_info.first->location);
+ tuple["declaration"] = idOrNull(_info.second.declaration);
+ tuple["isSlot"] = Json::Value(_info.second.isSlot);
+ tuple["isOffset"] = Json::Value(_info.second.isOffset);
+ tuple["valueSize"] = _info.second.valueSize;
+ return tuple;
+}
void ASTJsonConverter::print(ostream& _stream, ASTNode const& _node)
{
@@ -441,10 +451,10 @@ bool ASTJsonConverter::visit(InlineAssembly const& _node)
Json::Value externalReferences(Json::arrayValue);
for (auto const& it : _node.annotation().externalReferences)
{
- if (it.first && it.second)
+ if (it.first)
{
Json::Value tuple(Json::objectValue);
- tuple[it.first->name] = nodeId(*it.second);
+ tuple[it.first->name] = inlineAssemblyIdentifierToJson(it);
externalReferences.append(tuple);
}
}