Parse and report
The text is checked against the TOML grammar token by token. The first invalid construct stops the run and is reported with its line and column, so a file with several errors needs repeated fixes. Duplicate keys, trailing commas, unterminated strings, malformed dates, and unknown escape sequences are all rejected.