|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Fully resolved source position. More...
#include <ah-source.H>
Public Member Functions | |
| bool | is_valid () const noexcept |
| Returns whether the position refers to a registered file. | |
| std::string | to_string () const |
Formats the position as file:line:column or line:column. | |
Public Attributes | |
| Source_File_Id | file_id = 0 |
Stable file identifier; 0 means invalid. | |
| std::string | file_name |
| Human-readable file name. | |
| Source_Offset | offset = 0 |
| Byte offset in the file text. | |
| size_t | line = 1 |
| 1-based line number. | |
| size_t | column = 1 |
| 1-based column number. | |
Fully resolved source position.
A position belongs to a file, keeps the absolute byte offset in that file, and caches 1-based line/column numbers for presentation.
Definition at line 69 of file ah-source.H.
|
inlinenoexcept |
Returns whether the position refers to a registered file.
Definition at line 78 of file ah-source.H.
References file_id.
|
inline |
Formats the position as file:line:column or line:column.
Definition at line 84 of file ah-source.H.
References Aleph::blossom_maximum_cardinality_matching(), column, file_name, line, and out.
Referenced by Aleph::Diagnostic_Engine::render_secondary_labels().
| size_t Aleph::Source_Position::column = 1 |
| Source_File_Id Aleph::Source_Position::file_id = 0 |
Stable file identifier; 0 means invalid.
Definition at line 71 of file ah-source.H.
Referenced by is_valid().
| std::string Aleph::Source_Position::file_name |
| size_t Aleph::Source_Position::line = 1 |
| Source_Offset Aleph::Source_Position::offset = 0 |
Byte offset in the file text.
Definition at line 73 of file ah-source.H.