diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-11-20 16:59:01 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-11-20 16:59:01 +0100 |
commit | e609a3d6a94163f0dfea814378cd4e2dbed3d8e8 (patch) | |
tree | 6cbf379d8be0b2b2be6174becbd01bcc405ee022 | |
parent | 3b390967e7c2ee4ac6d1a67c77f40ed43005e012 (diff) |
Fix String pretty-printing
-rw-r--r-- | ast.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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<<c; |