code: func repeat(a *Automaton) *Automaton {
  	if isEmpty(a) {
  		return a
  	}
  
  	b := newAutomatonBuilder()
  	b.createState()
  	b.setAccept(0, true)
  	b.copy(a)
  
  	t := newTransition()
  	count := a.initTransition(0, t)
  	for i := 0; i < count; i++ {
  		a.nextTransition(t)
  		b.addTransitionRange(0, t.dest+1, t.min, t.max)
  	}
  
  	numStates := a.numStates()
  	for s := 0; s < numStates; s++ {
  		if a.IsAccept(s) {
  			count = a.initTransition(0, t)
  			for i := 0; i < count; i++ {
  				a.nextTransition(t)
  				b.addTransitionRange(s+1, t.dest+1, t.min, t.max)
  			}
  		}
  	}
  
  	return b.finish()
  }
docs: /*
  Returns an automaton that accepts the Kleene star (zero or more
  concatenated repetitions) of the language of the given automaton.
  Never modifies the input automaton language.
  
  Complexity: linear in number of states.
  */