A parser-based version of loop-protect.