This corrects a regression when pattern matching to the newline was added. If the newline is never matched the loop still needs to terminated so now when the position is before the newline and the last match had no tokens the loop is broken out of.