Renders diagnostic messages with source context and caret/tilde indicators, similar to clang/rustc output.
More...
|
| static std::string | format (std::string_view source, const ParseDiagnostic &diag, const Options &options) |
| | Format a single diagnostic against source text.
|
|
static std::string | format (std::string_view source, const ParseDiagnostic &diag) |
| | Format with default options.
|
| static std::string | formatAll (std::string_view source, const ParseWarningSink &sink, const Options &options) |
| | Format all warnings in a sink against source text.
|
|
static std::string | formatAll (std::string_view source, const ParseWarningSink &sink) |
| | Format all with default options.
|
Renders diagnostic messages with source context and caret/tilde indicators, similar to clang/rustc output.
Example output:
error: Unexpected character
--> test.svg:1:25
|
1 | <path d="M 100 100 h 2!" />
| ^
For multi-character ranges, tildes indicate the span:
warning: Invalid paint server value
--> line 4, col 12
|
4 | <path fill="url(#)"/>
| ^~~~~~