Pretty-print and validate YAML, with a clear error location for invalid input. Comments are preserved.