Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 5eb3f65e95375f1be49b0bbe3338a9b4b1d26c67)
+++ src/Parser/parser.yy	(revision 089b39e10a2775643258a72adda3f50aeb1ed600)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jun 24 22:45:20 2024
-// Update Count     : 6684
+// Last Modified On : Tue Jun 25 18:44:14 2024
+// Update Count     : 6692
 //
 
@@ -227,6 +227,5 @@
 #define MISSING_HIGH "illegal syntax, missing high value for down-to range so index is uninitialized."
 
-static ForCtrl * makeForCtrl( const CodeLocation & location, DeclarationNode * init, enum OperKinds compop,
-							  ExpressionNode * comp, ExpressionNode * inc ) {
+static ForCtrl * makeForCtrl( const CodeLocation & location, DeclarationNode * init, OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) {
 	// Wrap both comp/inc if they are non-null.
 	if ( comp ) comp = new ExpressionNode( build_binary_val( location,
@@ -243,5 +242,5 @@
 }
 
-ForCtrl * forCtrl( const CodeLocation & location, DeclarationNode * index, ExpressionNode * start, enum OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) {
+ForCtrl * forCtrl( const CodeLocation & location, DeclarationNode * index, ExpressionNode * start, OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) {
 	if ( index->initializer ) {
 		SemanticError( yylloc, "illegal syntax, direct initialization disallowed. Use instead: type var; initialization ~ comparison ~ increment." );
@@ -254,5 +253,5 @@
 } // forCtrl
 
-ForCtrl * forCtrl( const CodeLocation & location, ExpressionNode * type, string * index, ExpressionNode * start, enum OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) {
+ForCtrl * forCtrl( const CodeLocation & location, ExpressionNode * type, string * index, ExpressionNode * start, OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) {
 	ast::ConstantExpr * constant = dynamic_cast<ast::ConstantExpr *>(type->expr.get());
 	if ( constant && (constant->rep == "0" || constant->rep == "1") ) {
@@ -268,13 +267,7 @@
 #define MISSING_LOOP_INDEX "illegal syntax, only a single identifier or declaration allowed in initialization, e.g., for ( i; ... ) or for ( int i; ... ). Expression disallowed."
 
-ForCtrl * forCtrl( const CodeLocation & location, ExpressionNode * type, ExpressionNode * index, ExpressionNode * start, enum OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) {
+ForCtrl * forCtrl( const CodeLocation & location, ExpressionNode * type, ExpressionNode * index, ExpressionNode * start, OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) {
 	if ( auto identifier = dynamic_cast<ast::NameExpr *>(index->expr.get()) ) {
 		return forCtrl( location, type, new string( identifier->name ), start, compop, comp, inc );
-	// } else if ( auto commaExpr = dynamic_cast<ast::CommaExpr *>( index->expr.get() ) ) {
-	// 	if ( auto identifier = commaExpr->arg2.as<ast::NameExpr>() ) {
-	// 		return forCtrl( location, type, new string( identifier->name ), start, compop, comp, inc );
-	// 	} else {
-	// 		SemanticError( yylloc, "illegal syntax, loop-index name missing. Expression disallowed." ); return nullptr;
-	// 	} // if
 	} else {
 		SemanticError( yylloc, MISSING_LOOP_INDEX ); return nullptr;
@@ -282,19 +275,9 @@
 } // forCtrl
 
-ForCtrl * enumRangeCtrl( ExpressionNode * index_expr, ExpressionNode * range_over_expr ) {
+ForCtrl * enumRangeCtrl( ExpressionNode * index_expr, __attribute__((unused)) OperKinds compop, ExpressionNode * range_over_expr ) {
 	if ( auto identifier = dynamic_cast<ast::NameExpr *>(index_expr->expr.get()) ) {
 		DeclarationNode * indexDecl = DeclarationNode::newName( new std::string(identifier->name) );
 		assert( range_over_expr );
 		return new ForCtrl( new StatementNode( indexDecl ), range_over_expr );
-	// } else if (auto commaExpr = dynamic_cast<ast::CommaExpr *>( index_expr->expr.get() )) {
-	// 	if ( auto identifier = commaExpr->arg1.as<ast::NameExpr>() ) {
-	// 		assert( range_over_expr );
-	// 		DeclarationNode * indexDecl = distAttr(
-	// 			DeclarationNode::newTypeof( range_over_expr, true ),
-	// 			DeclarationNode::newName( new std::string( identifier->name) ) );
-	// 		return new ForCtrl( new StatementNode( indexDecl ), range_over_expr );
-	// 	} else {
-	// 		SemanticError( yylloc, "illegal syntax, loop-index name missing. Comma expression disallowed." ); return nullptr;
-	// 	} // if
 	} else {
 		SemanticError( yylloc, MISSING_LOOP_INDEX ); return nullptr;
@@ -1522,4 +1505,6 @@
 		{ SemanticError( yylloc, MISSING_ANON_FIELD ); $$ = nullptr; }
 
+		// These rules accept a comma_expression for the initialization, when only an identifier is correct. Being
+		// permissive allows for a better error message from forCtrl.
 	| comma_expression ';' comma_expression				// CFA
 		{ $$ = forCtrl( yylloc, $3, $1, NEW_ZERO, OperKinds::LThan, $3->clone(), NEW_ONE ); }
@@ -1622,5 +1607,5 @@
 	| comma_expression ';' enum_key						// CFA, enum type
 		{
-			$$ = enumRangeCtrl( $1, new ExpressionNode( new ast::TypeExpr( yylloc, $3->buildType() ) ) );
+			$$ = enumRangeCtrl( $1, OperKinds::LThan, new ExpressionNode( new ast::TypeExpr( yylloc, $3->buildType() ) ) );
 		}
 	| comma_expression ';' downupdowneq enum_key		// CFA, enum type, reverse direction
@@ -1629,5 +1614,5 @@
 				SemanticError( yylloc, "illegal syntax, all enumeration ranges are equal (all values). Remove \"=~\"." ); $$ = nullptr;
 			}
-			SemanticError( yylloc, "Type iterator is currently unimplemented." ); $$ = nullptr;
+			$$ = enumRangeCtrl( $1, $3, new ExpressionNode( new ast::TypeExpr( yylloc, $4->buildType() ) ) );
 		}
 	;
