rework parse errors into diagnostics