31 return lhs._span < rhs._span;
75 [[nodiscard]]
const std::string&
text()
const {
return _text; }
82 [[nodiscard]]
const Span&
span()
const {
return _span; }
Represents a short textual annotation attached to a Span in a source.
Definition: label.hpp:12
friend bool operator<(const Label &lhs, const Label &rhs)
Orders labels by their span to allow placement within a line/group.
Definition: label.hpp:30
const std::string & text() const
Returns the label text.
Definition: label.hpp:75
Label(std::string text, Span span)
Constructs a label with a human-readable message and the span it refers to.
friend bool operator<=(const Label &lhs, const Label &rhs)
Less-than-or-equal comparison derived from >=
Definition: label.hpp:42
friend bool operator>(const Label &lhs, const Label &rhs)
Greater-than comparison derived from <
Definition: label.hpp:54
const Span & span() const
Returns the span associated with this label.
Definition: label.hpp:82
friend bool operator>=(const Label &lhs, const Label &rhs)
Greater-than-or-equal comparison derived from <
Definition: label.hpp:66
Represents a contiguous region within a Source
Definition: span.hpp:12