Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 6c4ff370606f629244646c59a8efef930de4b862)
+++ src/CodeGen/CodeGenerator.cc	(revision 2b6c1e0966e6ac366e8bc25cc8135f61d8946b0e)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Tue Jun 02 11:45:06 2015
-// Update Count     : 65
+// Last Modified On : Tue Jun 02 13:25:22 2015
+// Update Count     : 118
 //
 
@@ -36,4 +36,10 @@
 namespace CodeGen {
 	int CodeGenerator::tabsize = 4;
+
+	// the kinds of statements that would ideally be separated by more whitespace
+	bool wantSpacing( Statement * stmt) {
+		return dynamic_cast< IfStmt * >( stmt ) || dynamic_cast< CompoundStmt * >( stmt ) ||
+			dynamic_cast< WhileStmt * >( stmt ) || dynamic_cast< ForStmt * > ( stmt ) || dynamic_cast< SwitchStmt *>( stmt );
+	}
 
 	CodeGenerator::CodeGenerator( std::ostream &os ) : cur_indent( 0 ), insideFunction( false ), output( os ) { }
@@ -429,22 +435,24 @@
   
 	void CodeGenerator::visit( TypeExpr *typeExpr ) {}
-  
-  
+
 	//*** Statements
 	void CodeGenerator::visit( CompoundStmt *compoundStmt ) {
 		std::list<Statement*> ks = compoundStmt->get_kids();
-
-		output << endl << string( cur_indent, ' ' ) << "{" << endl;
-
-		cur_indent += CodeGenerator::tabsize; 
+		output << "{" << endl;
+
+		cur_indent += CodeGenerator::tabsize;
 
 		for ( std::list<Statement *>::iterator i = ks.begin(); i != ks.end();  i++) {
-			output << string( cur_indent, ' ' ) << printLabels( (*i)->get_labels() )  ;
+			output << string( cur_indent, ' ' ) << printLabels( (*i)->get_labels() );
 			(*i)->accept(*this );
+
 			output << endl;
+			if ( wantSpacing( *i ) ) {
+				output << endl;
+			}
 		}
 		cur_indent -= CodeGenerator::tabsize; 
 
-		output << string( cur_indent, ' ' ) << "}" << endl;
+		output << string( cur_indent, ' ' ) << "}";
 	}
 
@@ -464,18 +472,11 @@
 		output << "if (";
 		ifStmt->get_condition()->accept(*this );
-		output << ")\n";
-
-		cur_indent += CodeGenerator::tabsize;
-		output << string( cur_indent, ' ' );
+		output << ") ";
+
 		ifStmt->get_thenPart()->accept(*this );
-		cur_indent -= CodeGenerator::tabsize; 
-		output << endl;
 
 		if ( ifStmt->get_elsePart() != 0) {
-			output << string( cur_indent, ' ' ) << " else " << endl ;
-
-			cur_indent += CodeGenerator::tabsize; 
+			output << " else ";
 			ifStmt->get_elsePart()->accept(*this );
-			cur_indent -= CodeGenerator::tabsize; 
 		} // if
 	}
@@ -485,7 +486,7 @@
 		output << "switch (" ;
 		switchStmt->get_condition()->accept(*this );
-		output << ")\n";
+		output << ") ";
 		
-		output << string( cur_indent, ' ' ) << "{" << std::endl;
+		output << "{" << std::endl;
 		cur_indent += CodeGenerator::tabsize;
 
@@ -494,5 +495,5 @@
 		cur_indent -= CodeGenerator::tabsize;
 
-		output << /* "\r" << */ string( cur_indent, ' ' ) << "}" << endl;
+		output << string( cur_indent, ' ' ) << "}";
 	}
 
@@ -500,7 +501,7 @@
 		output << string( cur_indent, ' ' );
 		if ( caseStmt->isDefault()) 
-			output << "default"  ;
+			output << "default";
 		else {
-			output << "case "  ;
+			output << "case ";
 			caseStmt->get_condition()->accept(*this );
 		} // if
@@ -540,5 +541,5 @@
 			break;
 		}
-		output << ";" << endl;
+		output << ";";
 	}
 
@@ -562,7 +563,7 @@
 			output << ")";
 		} // if
-		output << "\n";
-
-		output << string( cur_indent, ' ' ) << CodeGenerator::printLabels( whileStmt->get_body()->get_labels() );
+		output << " ";
+
+		output << CodeGenerator::printLabels( whileStmt->get_body()->get_labels() );
 		whileStmt->get_body()->accept( *this );
 
@@ -574,6 +575,4 @@
 			output << ");";
 		} // if
-
-		output << "\n";
 	}
 
@@ -592,8 +591,8 @@
 		if ( forStmt->get_increment() != 0 )
 			forStmt->get_increment()->accept( *this );
-		output << ")" << endl;
+		output << ") ";
 
 		if ( forStmt->get_body() != 0 ) {
-			output << string( cur_indent, ' ' ) << CodeGenerator::printLabels( forStmt->get_body()->get_labels() );
+			output << CodeGenerator::printLabels( forStmt->get_body()->get_labels() );
 			forStmt->get_body()->accept( *this );
 		} // if
Index: src/CodeGen/CodeGenerator.h
===================================================================
--- src/CodeGen/CodeGenerator.h	(revision 6c4ff370606f629244646c59a8efef930de4b862)
+++ src/CodeGen/CodeGenerator.h	(revision 2b6c1e0966e6ac366e8bc25cc8135f61d8946b0e)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Tue Jun 02 11:45:20 2015
-// Update Count     : 9
+// Last Modified On : Tue Jun 02 13:25:09 2015
+// Update Count     : 12
 //
 
@@ -32,6 +32,4 @@
 		CodeGenerator( std::ostream &os, std::string, int indent = 0, bool infun = false );
 		CodeGenerator( std::ostream &os, char *, int indent = 0, bool infun = false );
-
-		CodeGenerator( CodeGenerator & );
 
 		//*** Declaration
