From bc31b929427a28bddebffa2acdce474d38c66a82 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 15 Jan 2017 11:41:00 +0800 Subject: AST - Cleaner printing for stringify! --- src/parse/token.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/parse/token.cpp') 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(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*/"; -- cgit v1.2.3