41 virtual void loc(std::ostream&,
Loc)
const;
42 virtual void header(std::ostream&,
Loc,
Tag, std::string_view)
const;
44 virtual void note(std::ostream&,
Loc, std::string_view)
const;
45 virtual void summary(std::ostream&,
size_t num_errors,
size_t num_warnings,
bool truncated)
const;
50 virtual std::string
render(
const std::function<std::string()>& fmt)
const {
return fmt(); }
60 std::string
render(
const std::function<std::string()>&)
const override;
The Diag a Driver installs by default: colors a `citation` and drops its backticks - or keeps them ...
std::string render(const std::function< std::string()> &) const override
Postprocesses the text of one Error::Msg; the identity here, see CodeDiag.
virtual void summary(std::ostream &, size_t num_errors, size_t num_warnings, bool truncated) const
virtual void header(std::ostream &, Loc, Tag, std::string_view) const
The loc: tag: msg line.
virtual void note(std::ostream &, Loc, std::string_view) const
One note below the message it belongs to.
uint32_t max_rows
Rows a snippet streams before eliding its middle; 0 elides nothing.
bool werror
If true, a warning is recorded as an error.
uint32_t max_errors
Errors recorded before the rest is dropped; 0 keeps everything.
virtual void snippet(std::ostream &, Loc, Tag) const
The underlined source excerpt.
static term::FG tag2color(Tag)
bool no_snippet
If true, a diagnostic is only its header line.
uint32_t gutter
Width of the line-number column.
Loc::Style loc_style
How Diag::loc spells out a position.
virtual void loc(std::ostream &, Loc) const
Just the position.
virtual std::string render(const std::function< std::string()> &fmt) const
Postprocesses the text of one Error::Msg; the identity here, see CodeDiag.
Diag(const Diag &)=delete
Collects diagnostics and hands each to the Diag that lays it out.
FG
Foreground colors that can be streamed into an std::ostream.
FE_API std::ostream & operator<<(std::ostream &, Diag::Tag)
Location within a Src: the half-open byte range [Loc::begin, Loc::end).
Style
How much of a Loc a diagnostic spells out; see Diag::loc_style.
@ Full
path:row:col-row:col - the whole range.