Parse at the boundary
Parse when the text enters and keep values after that. Every later comparison on raw text is a bug waiting to happen.
A broken file is a state
A file that fails to parse is a real condition. Report the path and the line, then decide whether to continue.