aboutsummaryrefslogtreecommitdiffstats
path: root/src/pprint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pprint.cpp')
-rw-r--r--src/pprint.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pprint.cpp b/src/pprint.cpp
index 5ee5736..391609a 100644
--- a/src/pprint.cpp
+++ b/src/pprint.cpp
@@ -24,6 +24,10 @@
ostream&
operator<<(ostream& out, const AST* ast)
{
+ const ALexeme* lexeme = ast->to<const ALexeme*>();
+ if (lexeme)
+ return out << *lexeme;
+
const ALiteral<float>* flit = ast->to<const ALiteral<float>*>();
if (flit)
return out << showpoint << flit->val;
@@ -38,7 +42,7 @@ operator<<(ostream& out, const AST* ast)
const AString* str = ast->to<const AString*>();
if (str)
- return out << *str;
+ return out << '"' << *str << '"';
const ASymbol* sym = ast->to<const ASymbol*>();
if (sym)