|
|
Donner 0.5.0
Embeddable browser-grade SVG2 engine
|
Renders diagnostic messages with source context and caret/tilde indicators, similar to clang/rustc output. More...
#include "donner/base/DiagnosticRenderer.h"
Classes | |
| struct | Options |
| Options for rendering diagnostics. More... | |
Static Public Member Functions | |
| 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) |
| 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) |
Renders diagnostic messages with source context and caret/tilde indicators, similar to clang/rustc output.
Example output:
For multi-character ranges, tildes indicate the span:
| struct donner::DiagnosticRenderer::Options |
|
static |
Format a single diagnostic against source text.
| source | The original source text that was parsed. |
| diag | The diagnostic to render. |
| options | Rendering options. |
|
static |
Format all warnings in a sink against source text.
| source | The original source text that was parsed. |
| sink | Warning sink containing diagnostics to render. |
| options | Rendering options. |