I think you want to clean up the EOF token after the code below which skips the leftover tokens, regardless of whether Tok is EOF. You can do it unconditionally since Tok.getLocation() == OrigLoc and you know the token is the EOF inserted above.

ahatanak: I think you want to clean up the EOF token after the code below which skips the leftover tokens…