From e609a3d6a94163f0dfea814378cd4e2dbed3d8e8 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 20 Nov 2016 16:59:01 +0100 Subject: Fix String pretty-printing --- ast.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ast.cpp b/ast.cpp index 88d716a..68d4d4b 100644 --- a/ast.cpp +++ b/ast.cpp @@ -199,9 +199,10 @@ ostream& operator<<(ostream &os,const AST &ast){ os<<'"'; for(char c : ast.strval){ switch(c){ - case 9: os<<"\\t"; break; - case 10: os<<"\\n"; break; - case 13: os<<"\\r"; break; + case '\t': os<<"\\t"; break; + case '\n': os<<"\\n"; break; + case '\r': os<<"\\r"; break; + case '"': os<<"\\\""; break; default: if(c>=32&&c<=126){ os<