private static boolean enhanceLoop(DoStatement stat) {
    LoopType oldLoop = stat.getLoopType();

    switch (oldLoop) {
      case DO -> {

        // identify a while loop
        if (matchWhile(stat)) {
          // identify a for loop - subtype of while
          matchFor(stat);
        }
        else {
          // identify a do{}while loop
          matchDoWhile(stat);
        }
      }
      case WHILE -> matchFor(stat);
    }

    return (stat.getLoopType() != oldLoop);
  }
private static boolean enhanceLoop(DoStatement stat)