function rep(fragment) {
  fragment.in.addTransition(EPSILON, fragment.out);
  fragment.out.addTransition(EPSILON, fragment.in);
  return fragment;
}
function rep(fragment) {
  fragment.in.addTransition(EPSILON, fragment.out);
  fragment.out.addTransition(EPSILON, fragment.in);
  return fragment;
}
function rep ( fragment ) { fragment . in . addTransition ( EPSILON , fragment . out ) ; fragment . out . addTransition ( EPSILON , fragment . in ) ; return fragment ; }
Optimized Kleene-star: just adds ε-transitions from
input to the output, and back.
Optimized Kleene - star : just adds ε - transitions from input to the output and back .