From c1168a00ff143f752f386550e6acd42b0599c341 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 5 Feb 2017 21:45:16 +0100 Subject: Fix pretty-printing output --- ast.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ast.cpp b/ast.cpp index d1742e2..d903ad5 100644 --- a/ast.cpp +++ b/ast.cpp @@ -55,7 +55,7 @@ Scope::Scope(Type type,const StatementList &body,const vector &args) }*/ string indent(int amount){ - return string(amount*4,' '); + return string(amount,'\t'); } ostream& operator<<(ostream &os,const Scope &scope){ @@ -74,14 +74,15 @@ ostream& operator<<(ostream &os,const Scope &scope){ } os<<')'; } + if(scope.body.size()==0)return os<<"{}"; os<<"{\n"; os.iword(indent_level_index)++; int level=os.iword(indent_level_index); - os<=32&&c<=126)os<