fix endless loop of the parser if EOF is reached while error recovering