diff options
author | chriseth <chris@ethereum.org> | 2017-08-25 18:43:58 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-29 22:50:28 +0800 |
commit | cd22da1d9e77a9a7b6fe3ecf5bd828977acc6282 (patch) | |
tree | 2360a810f3d800407a5bbd4e6bd483b51dfa028f /libsolidity/ast | |
parent | a3f77527e9da0005e3c6d9cbd4c6a56c17c1089c (diff) | |
download | dexon-solidity-cd22da1d9e77a9a7b6fe3ecf5bd828977acc6282.tar.gz dexon-solidity-cd22da1d9e77a9a7b6fe3ecf5bd828977acc6282.tar.zst dexon-solidity-cd22da1d9e77a9a7b6fe3ecf5bd828977acc6282.zip |
Remove escape function.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/ASTPrinter.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libsolidity/ast/ASTPrinter.cpp b/libsolidity/ast/ASTPrinter.cpp index 392179ef..09191433 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 <libdevcore/JSON.h> + +#include <boost/algorithm/string/join.hpp> + using namespace std; namespace dev @@ -579,8 +582,13 @@ 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: " << + /// Note: this "abuses" the JSON library to print a string (as it is not a valid root node). + /// It also makes a copy of the string. + jsonCompactPrint(m_source.substr(location.start, location.end - location.start)) << + endl; } } |