summaryrefslogtreecommitdiff
path: root/src/parse/token.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-15 11:41:00 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-15 11:41:00 +0800
commitbc31b929427a28bddebffa2acdce474d38c66a82 (patch)
tree273003645097c33e4fb18ba55fc0cfb4cb670008 /src/parse/token.cpp
parenta7c602469093f083a3d27e60d1b30766803891e6 (diff)
downloadmrust-bc31b929427a28bddebffa2acdce474d38c66a82.tar.gz
AST - Cleaner printing for stringify!
Diffstat (limited to 'src/parse/token.cpp')
-rw-r--r--src/parse/token.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parse/token.cpp b/src/parse/token.cpp
index 13af2043..69b952cc 100644
--- a/src/parse/token.cpp
+++ b/src/parse/token.cpp
@@ -293,7 +293,11 @@ struct EscapedString {
case TOK_INTERPOLATED_TYPE: return "/*:ty*/";
case TOK_INTERPOLATED_PATH: return "/*:path*/";
case TOK_INTERPOLATED_PATTERN: return "/*:pat*/";
- case TOK_INTERPOLATED_EXPR: return "/*:expr*/";
+ case TOK_INTERPOLATED_EXPR: {
+ ::std::stringstream ss;
+ reinterpret_cast<const ::AST::ExprNode*>(m_data.as_Fragment())->print(ss);
+ return ss.str();
+ }
case TOK_INTERPOLATED_STMT: return "/*:stmt*/";
case TOK_INTERPOLATED_BLOCK: return "/*:block*/";
case TOK_INTERPOLATED_META: return "/*:meta*/";