• Replaces for loop with an equivalent construct based on a while loop:

    for (init; cond; step) {
      //...
      continue;
      //...
      //...
    }
    

    becomes

    {
      init;
      while (cond) {
        // ...
        goto __for_loop_step_${step_label_suffix};
        // ...
        // ...
    __for_loop_step_${step_label_suffix}:
        step;
      }
    }
    

    Parameters

    • $forStmt: Loop

      For-loop joinpoint

    • stepLabelSuffix: string | number

      Suffix to attach to the for loop step label, added in case there are continue statements to account for

    Returns Scope

    The newly created replacement joinpoint