Code review comment: Is it possible to add a comment showing the before desugar and after desugar code similar to`desugarForeachToWhileWithIterator()` method?  https://github.com/ballerina-platform/ballerina-lang/blob/ceb5155986a87aa68cea016262534f9fe9aa097d/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/Desugar.java#L5315-L5340

Code under review:
private BLangBlockStmt desugarForeachToWhileWithoutIterator(BLangForeach foreach) {
        Location pos = foreach.pos;
        BLangBlockStmt scopeBlock = ASTBuilderUtil.createBlockStmt(pos);
        if (foreach.collection.getKind() == NodeKind.BINARY_EXPR) {
            BLangBinaryExpr rangeExpr = (BLangBinaryExpr) foreach.collection;
            OperatorKind comparisonOp =
                    rangeExpr.opKind == OperatorKind.HALF_OPEN_RANGE ? OperatorKind.LESS_THAN : OperatorKind.LESS_EQUAL;
            Function<BLangVariableReference, BLangExpression> loopValueGenerator =
                    (BLangVariableReference indexVarRef) -> indexVarRef;
            finishDesugarForeachToWhile(foreach, rangeExpr.lhsExpr, rangeExpr.rhsExpr, comparisonOp, loopValueGenerator,
                    scopeBlock);
            return scopeBlock;
        }
        BSymbol listSymbol =
                addTemporaryVariableToScope(pos, "$data$", foreach.collection, foreach.collection.expectedType,
                        scopeBlock);
        BLangExpression listRef = ASTBuilderUtil.createVariableRef(pos, listSymbol);
        BLangExpression indexInitVal = ASTBuilderUtil.createLiteral(pos, symTable.intType, 0L);
        BLangExpression indexMaxVal =
                createLangLibInvocationNode("length", listRef, new ArrayList<>(), symTable.intType, pos);
        OperatorKind comparisonOp = OperatorKind.LESS_THAN;

        Function<BLangVariableReference, BLangExpression> loopValueGenerator =
                (BLangVariableReference indexVarRef) -> {
                    BLangVariable loopVal = (BLangVariable) foreach.variableDefinitionNode.getVariable();
                    return ASTBuilderUtil.createIndexBasesAccessExpr(pos, loopVal.getBType(), (BVarSymbol) listSymbol,
                            indexVarRef);
                };
        finishDesugarForeachToWhile(foreach, indexInitVal, indexMaxVal, comparisonOp, loopValueGenerator, scopeBlock);
        return scopeBlock;
    }

Line commented on: indexVarRef);

Revised code:
private BLangBlockStmt desugarForeachToWhileWithoutIterator(BLangForeach foreach) {
        Location pos = foreach.pos;
        BLangBlockStmt scopeBlock = ASTBuilderUtil.createBlockStmt(pos);
        if (foreach.collection.getKind() == NodeKind.BINARY_EXPR) {
            BLangBinaryExpr rangeExpr = (BLangBinaryExpr) foreach.collection;
            OperatorKind comparisonOp =
                    rangeExpr.opKind == OperatorKind.HALF_OPEN_RANGE ? OperatorKind.LESS_THAN : OperatorKind.LESS_EQUAL;
            Function<BLangVariableReference, BLangExpression> loopValueGenerator =
                    (BLangVariableReference indexVarRef) -> indexVarRef;
            finishDesugarForeachToWhile(foreach, rangeExpr.lhsExpr, rangeExpr.rhsExpr, comparisonOp, loopValueGenerator,
                    scopeBlock);
            return scopeBlock;
        }
        BSymbol listSymbol =
                addTemporaryVariableToScope(pos, "$data$", foreach.collection, foreach.collection.expectedType,
                        scopeBlock);
        BLangExpression listRef = ASTBuilderUtil.createVariableRef(pos, listSymbol);
        BLangExpression indexInitVal = ASTBuilderUtil.createLiteral(pos, symTable.intType, 0L);
        BLangExpression indexMaxVal =
                createLangLibInvocationNode("length", listRef, new ArrayList<>(), symTable.intType, pos);
        OperatorKind comparisonOp = OperatorKind.LESS_THAN;

        Function<BLangVariableReference, BLangExpression> loopValueGenerator =
                (BLangVariableReference indexVarRef) -> {
                    BLangVariable loopVal = (BLangVariable) foreach.variableDefinitionNode.getVariable();
                    return ASTBuilderUtil.createIndexBasesAccessExpr(pos, loopVal.getBType(), (BVarSymbol) listSymbol,
                            indexVarRef);
                };
        finishDesugarForeachToWhile(foreach, indexInitVal, indexMaxVal, comparisonOp, loopValueGenerator, scopeBlock);
        return scopeBlock;
    }