|
Pretty Diagnostics
Create your own pretty diagnostics
|
Represents a short textual annotation attached to a Span in a source.
More...
#include <label.hpp>
Public Member Functions | |
| Label (std::string text, Span span) | |
| Constructs a label with a human-readable message and the span it refers to. More... | |
| const std::string & | text () const |
| Returns the label text. More... | |
| const Span & | span () const |
| Returns the span associated with this label. More... | |
Friends | |
| bool | operator< (const Label &lhs, const Label &rhs) |
| Orders labels by their span to allow placement within a line/group. More... | |
| bool | operator<= (const Label &lhs, const Label &rhs) |
Less-than-or-equal comparison derived from >= More... | |
| bool | operator> (const Label &lhs, const Label &rhs) |
Greater-than comparison derived from < More... | |
| bool | operator>= (const Label &lhs, const Label &rhs) |
Greater-than-or-equal comparison derived from < More... | |
Represents a short textual annotation attached to a Span in a source.
Labels are ordered by their underlying Span to support stable grouping and rendering of diagnostics
| pretty_diagnostics::Label::Label | ( | std::string | text, |
| Span | span | ||
| ) |
Constructs a label with a human-readable message and the span it refers to.
| text | Short message to display next to the span in the rendered output |
| span | Source span this label highlights |
|
inline |
Returns the span associated with this label.
|
inline |
Returns the label text.
Orders labels by their span to allow placement within a line/group.
| lhs | Left-hand label |
| rhs | Right-hand label |
lhs's span starts before rhs's span Less-than-or-equal comparison derived from >=
| lhs | Left-hand label |
| rhs | Right-hand label |
lhs is not greater than rhs Greater-than comparison derived from <
| lhs | Left-hand label |
| rhs | Right-hand label |
lhs is ordered after rhs Greater-than-or-equal comparison derived from <
| lhs | Left-hand label |
| rhs | Right-hand label |
lhs is not less than rhs