Fix failing parser error message test
Optimized `repeat` and its tests