Fix parser infinite loop in xhp_format

Summary: We need to look for `Teof`.

Reviewed By: @joelbeales

Differential Revision: D1478814