Get out of the infinite loop by allowing to scan backwards when the current token is a comment.

This fixes issue #9002.
@RaymondLim I didn't mean to remove the break statements in those cases -- just remove the break statements that go with the movePrevToken() calls.  That should preserve the existing behavior precisely.