|
FE 0.15.0
A C++23 toolkit for writing compiler/interpreter frontends.
|
Byte offset into a Src; pass around as value. More...
#include <fe/loc.h>
Public Member Functions | |
| constexpr | Pos () noexcept=default |
| Creates an invalid Position. | |
| constexpr | Pos (uint32_t off) noexcept |
| constexpr | operator bool () const noexcept |
| Is a valid Position? | |
| constexpr auto | operator<=> (const Pos &) const noexcept=default |
| constexpr Pos | operator+ (uint32_t n) const noexcept |
| void | dump () const |
Public Attributes | |
| uint32_t | off = Invalid |
Static Public Attributes | |
| static constexpr uint32_t | Invalid = uint32_t(-1) |
Friends | |
| std::ostream & | operator<< (std::ostream &os, Pos pos) |
Byte offset into a Src; pass around as value.
A Position is just an index - fe::Src turns it back into the row/column a human wants to read.
|
constexprdefaultnoexcept |
Creates an invalid Position.
Referenced by fe::Lexer< K, S >::accept_while(), fe::Src::begin(), fe::Src::end(), operator+(), operator<<, operator<=>(), and Pos().
|
inlineexplicitconstexprnoexcept |
| void fe::Pos::dump | ( | ) | const |
|
inlineexplicitconstexprnoexcept |
|
inlineconstexprnoexcept |
|
staticconstexpr |
Definition at line 17 of file loc.h.
Referenced by operator bool(), and operator+().
| uint32_t fe::Pos::off = Invalid |
Definition at line 31 of file loc.h.
Referenced by fe::Lexer< K, S >::accept_while(), fe::Src::contains(), operator bool(), operator+(), Pos(), fe::Loc::size(), and fe::Lexer< K, S >::view().