|
Pretty Diagnostics
Create your own pretty diagnostics
|
A position inside a Source, expressed as (row, column, index)
More...
#include <source.hpp>
Public Member Functions | |
| Location (size_t row, size_t column, size_t index) | |
| Constructs a location with the given coordinates and absolute index. More... | |
| Location () | |
| Constructs a default-initialized location (all -1). More... | |
| auto | column () const |
| Returns the 0-based column number. More... | |
| auto | index () const |
| Returns the 0-based absolute character index. More... | |
| auto | row () const |
| Returns the 0-based row (line) number. More... | |
Friends | |
| bool | operator< (const Location &lhs, const Location &rhs) |
| Orders locations by their absolute index. More... | |
| bool | operator<= (const Location &lhs, const Location &rhs) |
Less-than-or-equal comparison derived from >= More... | |
| bool | operator> (const Location &lhs, const Location &rhs) |
Greater-than comparison derived from < More... | |
| bool | operator>= (const Location &lhs, const Location &rhs) |
Greater-than-or-equal comparison derived from < More... | |
| bool | operator== (const Location &lhs, const Location &rhs) |
| Equality compares row, column and index. More... | |
| bool | operator!= (const Location &lhs, const Location &rhs) |
Inequality based on operator== More... | |
A position inside a Source, expressed as (row, column, index)
The index is a 0-based absolute character offset into the source contents. row and column represent human-readable coordinates, the index defines ordering
| pretty_diagnostics::Location::Location | ( | size_t | row, |
| size_t | column, | ||
| size_t | index | ||
| ) |
Constructs a location with the given coordinates and absolute index.
| row | 0-based line number |
| column | 0-based column number |
| index | 0-based absolute character index |
| pretty_diagnostics::Location::Location | ( | ) |
Constructs a default-initialized location (all -1).
|
inline |
Returns the 0-based column number.
|
inline |
Returns the 0-based absolute character index.
|
inline |
Returns the 0-based row (line) number.
Inequality based on operator==
| lhs | Left-hand location |
| rhs | Right-hand location |
Orders locations by their absolute index.
| lhs | Left-hand location |
| rhs | Right-hand location |
lhs precedes rhs by absolute index Less-than-or-equal comparison derived from >=
| lhs | Left-hand location |
| rhs | Right-hand location |
lhs is not greater than rhs Equality compares row, column and index.
| lhs | Left-hand location |
| rhs | Right-hand location |
Greater-than comparison derived from <
| lhs | Left-hand location |
| rhs | Right-hand location |
lhs succeeds rhs by absolute index Greater-than-or-equal comparison derived from <
| lhs | Left-hand location |
| rhs | Right-hand location |
lhs is not less than rhs