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

The underlined source excerpt that goes below a diagnostic. More...

#include <fe/snippet.h>

Public Attributes

Loc loc
term::FG color = term::FG::Red
uint32_t gutter = 5
 Width of the line-number column.
uint32_t max_rows = 8
 Rows streamed before the middle is elided; 0 elides nothing.

Friends

std::ostream & operator<< (std::ostream &, const Snippet &)
 fe/snippet.h merely declares this.

Detailed Description

The underlined source excerpt that goes below a diagnostic.

Streams every source row Snippet::loc spans, each underlining the columns Snippet::loc covers on it. Streams nothing if Snippet::loc has no Loc::src or does not resolve within it.

Definition at line 15 of file snippet.h.

◆ operator<<

std::ostream & operator<< ( std::ostream & ,
const Snippet &  )
friend

fe/snippet.h merely declares this.

Link fe-lib for the default implementation, or provide your own in namespace fe.

Member Data Documentation

◆ color

term::FG fe::Snippet::color = term::FG::Red

Definition at line 17 of file snippet.h.

◆ gutter

uint32_t fe::Snippet::gutter = 5

Width of the line-number column.

Definition at line 18 of file snippet.h.

◆ loc

Loc fe::Snippet::loc

Definition at line 16 of file snippet.h.

◆ max_rows

uint32_t fe::Snippet::max_rows = 8

Rows streamed before the middle is elided; 0 elides nothing.

Definition at line 19 of file snippet.h.


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