Fix parser when input has no trailing newline.