I had just corrected a bug in LPeg that is probably the cause of this seg fault. Mainly, the loop in the peephole function should be this: