|
Porytiles
|
Represents a position within source content. More...
#include <source_position.hpp>
Public Member Functions | |
| std::string | to_string () const |
| Formats the position as "line:column". | |
| bool | operator== (const SourcePosition &other) const =default |
| Compares two positions for equality. | |
Public Attributes | |
| std::size_t | line {1} |
| 1-based line number | |
| std::size_t | column {1} |
| 1-based column number | |
Represents a position within source content.
SourcePosition tracks the line number and column number within source text. Line and column numbers are 1-based to match conventional editor/compiler conventions. This is used by Token and error messages to provide helpful location information.
Definition at line 16 of file source_position.hpp.
|
default |
Compares two positions for equality.
| other | The other position to compare against |
|
inline |
Formats the position as "line:column".
Definition at line 25 of file source_position.hpp.
| std::size_t porytiles::SourcePosition::column {1} |
1-based column number
Definition at line 18 of file source_position.hpp.
| std::size_t porytiles::SourcePosition::line {1} |
1-based line number
Definition at line 17 of file source_position.hpp.