aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast/ASTPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/ast/ASTPrinter.cpp')
-rw-r--r--libsolidity/ast/ASTPrinter.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libsolidity/ast/ASTPrinter.cpp b/libsolidity/ast/ASTPrinter.cpp
index 392179ef..81e6cc44 100644
--- a/libsolidity/ast/ASTPrinter.cpp
+++ b/libsolidity/ast/ASTPrinter.cpp
@@ -21,9 +21,12 @@
*/
#include <libsolidity/ast/ASTPrinter.h>
-#include <boost/algorithm/string/join.hpp>
#include <libsolidity/ast/AST.h>
+#include <json/json.h>
+
+#include <boost/algorithm/string/join.hpp>
+
using namespace std;
namespace dev
@@ -579,8 +582,11 @@ void ASTPrinter::printSourcePart(ASTNode const& _node)
if (!m_source.empty())
{
SourceLocation const& location(_node.location());
- *m_ostream << indentation() << " Source: "
- << escaped(m_source.substr(location.start, location.end - location.start), false) << endl;
+ *m_ostream <<
+ indentation() <<
+ " Source: " <<
+ Json::valueToQuotedString(m_source.substr(location.start, location.end - location.start).c_str()) <<
+ endl;
}
}