mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Set handlers use unified jsonPrint with prettifier if needed
This commit is contained in:
@@ -190,9 +190,9 @@ Json::Value ASTJsonConverter::inlineAssemblyIdentifierToJson(pair<yul::Identifie
|
||||
return tuple;
|
||||
}
|
||||
|
||||
void ASTJsonConverter::print(ostream& _stream, ASTNode const& _node)
|
||||
void ASTJsonConverter::print(ostream& _stream, ASTNode const& _node, util::JsonFormat const& _format)
|
||||
{
|
||||
_stream << util::jsonPrettyPrint(toJson(_node));
|
||||
_stream << util::jsonPrint(toJson(_node), _format);
|
||||
}
|
||||
|
||||
Json::Value ASTJsonConverter::toJson(ASTNode const& _node)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <liblangutil/Exceptions.h>
|
||||
|
||||
#include <json/json.h>
|
||||
#include <libsolutil/JSON.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <optional>
|
||||
@@ -58,7 +59,7 @@ public:
|
||||
std::map<std::string, unsigned> _sourceIndices = std::map<std::string, unsigned>()
|
||||
);
|
||||
/// Output the json representation of the AST to _stream.
|
||||
void print(std::ostream& _stream, ASTNode const& _node);
|
||||
void print(std::ostream& _stream, ASTNode const& _node, util::JsonFormat const& _format);
|
||||
Json::Value toJson(ASTNode const& _node);
|
||||
template <class T>
|
||||
Json::Value toJson(std::vector<ASTPointer<T>> const& _nodes)
|
||||
|
||||
Reference in New Issue
Block a user