FE 0.13.1
Header-only C++ frontend library
Loading...
Searching...
No Matches
fe::CodeDiag Class Reference

The Diag a Driver installs by default: colors a `citation` and drops its backticks - or keeps them verbatim without color; \` is a literal backtick. More...

#include <fe/diag.h>

Inheritance diagram for fe::CodeDiag:
[legend]

Public Member Functions

std::string render (const std::function< std::string()> &) const override
 Postprocesses the text of one Error::Msg; the identity here, see CodeDiag.
Public Member Functions inherited from fe::Diag
 Diag ()=default
 Diag (const Diag &)=delete
virtual ~Diag ()
virtual void loc (std::ostream &, Loc) const
 Just the position.
virtual void header (std::ostream &, Loc, Tag, std::string_view) const
 The loc: tag: msg line.
virtual void snippet (std::ostream &, Loc, Tag) const
 The underlined source excerpt.
virtual void note (std::ostream &, Loc, std::string_view) const
 One note below the message it belongs to.
virtual void summary (std::ostream &, size_t num_errors, size_t num_warnings, bool truncated) const

Additional Inherited Members

Public Types inherited from fe::Diag
enum class  Tag {
  Error ,
  Warn ,
  Note
}
Static Public Member Functions inherited from fe::Diag
static term::FG tag2color (Tag)
Public Attributes inherited from fe::Diag
uint32_t gutter = 5
 Width of the line-number column.
uint32_t max_rows = 8
 Rows a snippet streams before eliding its middle; 0 elides nothing.
uint32_t max_errors = 0
 Errors recorded before the rest is dropped; 0 keeps everything.
bool no_snippet = false
 If true, a diagnostic is only its header line.
bool werror = false
 If true, a warning is recorded as an error.
Loc::Style loc_style = Loc::Style::Full
 How Diag::loc spells out a position.

Detailed Description

The Diag a Driver installs by default: colors a `citation` and drops its backticks - or keeps them verbatim without color; \` is a literal backtick.

Warning
Renders when the message is recorded, so Mode::Auto needs term::resolve_mode up front.

Definition at line 58 of file diag.h.

Member Function Documentation

◆ render()

std::string fe::CodeDiag::render ( const std::function< std::string()> & fmt) const
overridevirtual

Postprocesses the text of one Error::Msg; the identity here, see CodeDiag.

Warning
fmt captures its arguments by reference and is only valid for that one call.

Reimplemented from fe::Diag.


The documentation for this class was generated from the following file: