mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
include new InlineAssemblyInformation into JSON
This commit is contained in:
parent
a4ba5ace8a
commit
e3583d04f7
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -128,6 +128,7 @@ private:
|
||||
{
|
||||
return _node ? toJson(*_node) : Json::nullValue;
|
||||
}
|
||||
Json::Value inlineAssemblyIdentifierToJson(std::pair<assembly::Identifier const* , InlineAssemblyAnnotation::ExternalIdentifierInfo> _info);
|
||||
std::string visibility(Declaration::Visibility const& _visibility);
|
||||
std::string location(VariableDeclaration::Location _location);
|
||||
std::string contractKind(ContractDefinition::ContractKind _kind);
|
||||
|
Loading…
Reference in New Issue
Block a user