File tree Expand file tree Collapse file tree
main/java/org/apache/groovy/parser/antlr4 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -704,7 +704,6 @@ originalForControl
704704
705705forInit
706706 : localVariableDeclaration
707- | expressionList[false]
708707 ;
709708
710709forUpdate
Original file line number Diff line number Diff line change @@ -545,10 +545,6 @@ public Expression visitForInit(final ForInitContext ctx) {
545545 }
546546 }
547547
548- if (asBoolean (ctx .expressionList ())) {
549- return this .translateExpressionList (ctx .expressionList ());
550- }
551-
552548 throw createParsingFailedException ("Unsupported for init: " + ctx .getText (), ctx );
553549 }
554550
@@ -558,14 +554,9 @@ public Expression visitForUpdate(final ForUpdateContext ctx) {
558554 return EmptyExpression .INSTANCE ;
559555 }
560556
561- return this .translateExpressionList (ctx .expressionList ());
562- }
563-
564- private Expression translateExpressionList (final ExpressionListContext ctx ) {
565- List <Expression > expressionList = this .visitExpressionList (ctx );
566-
557+ var expressionList = this .visitExpressionList (ctx .expressionList ());
567558 if (expressionList .size () == 1 ) {
568- return configureAST (expressionList .get (0 ), ctx );
559+ return configureAST (expressionList .get (0 ), ctx ); // one Expression
569560 } else {
570561 return configureAST (new ClosureListExpression (expressionList ), ctx );
571562 }
You can’t perform that action at this time.
0 commit comments