#include "cparse/Parser.hh" // pulled in transitively by "fson/Fson.hh"
The diagnostic type used throughout fson. It comes from the cparse library, not fson — which is why a program using fson links both libfson and libcparse (see Install).
| Field | Type | Meaning |
|---|---|---|
kind | enum class Kind { Syntax, Type, Faulty, Internal, Warning } | severity / class |
message | std::string | human-readable description |
filename | std::string | the file the error is in (an %include target, when relevant) |
line | int | 1-based |
col | int | 1-based |
fson-check prints them as:
config.fson:7:3: syntax error: expected ':' after key
mapping Kind → syntax error / type error / error / internal error / warning.
Where they surface
| API | Access |
|---|---|
Fson::load | LoadResult::errors (a std::vector<ParseError>) |
FsonParser | parser.errors() / parser.hasErrors() |
A Warning never blocks a write-back — the lexeme is preserved, so the output stays faithful. LoadResult::ok() is false only for something worse than a warning.

