Implement repeat statement in transformer module