Index: src/CodeGen/CodeGenerator.cpp
===================================================================
--- src/CodeGen/CodeGenerator.cpp	(revision e48aca8ae51f025285f95f19f58f543a0bfdec0b)
+++ src/CodeGen/CodeGenerator.cpp	(revision 42bce4e08d884435f97302a45c73b9afcbc008ab)
@@ -10,6 +10,6 @@
 // Created On       : Tue Oct 17 15:54:00 2023
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jan 17 14:19:22 2025
-// Update Count     : 1
+// Last Modified On : Wed Mar 11 11:13:10 2026
+// Update Count     : 28
 //
 
@@ -49,6 +49,5 @@
 }
 
-CodeGenerator::LabelPrinter & CodeGenerator::LabelPrinter::operator()(
-		std::vector<ast::Label> const & l ) {
+CodeGenerator::LabelPrinter & CodeGenerator::LabelPrinter::operator()( std::vector<ast::Label> const & l ) {
 	labels = &l;
 	return *this;
@@ -1245,7 +1244,7 @@
 		output << "do";
 	} else {
-		output << "while (";
+		output << "while ( ";
 		stmt->cond->accept( *visitor );
-		output << ")";
+		output << " )";
 	}
 	output << " ";
@@ -1255,23 +1254,22 @@
 
 	if ( stmt->isDoWhile ) {
-		output << " while (";
+		output << " while ( ";
 		stmt->cond->accept( *visitor );
-		output << ( ( nullptr == stmt->else_ ) ? ");" : ")" );
-	}
+		output << " );";								// always terminate with semi-colon
+	}
+
 	if ( stmt->else_ ) {
-		output << " else ";
-		stmt->else_->accept( *visitor );
+		stmt->else_->accept( *visitor );				// not converted in AST pass
 	}
 }
 
 void CodeGenerator::postvisit( ast::ForStmt const * stmt ) {
-	// Initializer is always hoised so don't generate it.
-	// TODO: Do an assertion check?
-	output << "for (;";
+	assert( stmt->inits.empty() );						// initializer is hoisted
+	output << "for ( ; ";								// empty initializer
 
 	if ( nullptr != stmt->cond ) {
 		stmt->cond->accept( *visitor );
 	}
-	output << ";";
+	output << "; ";										// separator
 
 	if ( nullptr != stmt->inc ) {
@@ -1280,5 +1278,5 @@
 		expr->accept( *visitor );
 	}
-	output << ") ";
+	output << " ) ";
 
 	if ( nullptr != stmt->body ) {
@@ -1288,7 +1286,5 @@
 
 	if ( nullptr != stmt->else_ ) {
-		assertf( !options.genC, "Loop else should not reach code generation." );
-		output << " else ";
-		stmt->else_->accept( *visitor );
+		stmt->else_->accept( *visitor );				// not converted in AST pass
 	}
 }
