58 parse_location(
int line,
int column) noexcept : _file(), _line(line - 1), _column(column - 1) {}
60 [[nodiscard]]
bool has_file() const noexcept {
61 return static_cast<bool>(_file);
64 [[nodiscard]] URL
const &file() const noexcept {
68 [[nodiscard]]
int line() const noexcept {
72 [[nodiscard]]
int column() const noexcept {
77 return {_line + 1, _column + 1};
84 void set_file(URL file) {
85 _file = std::make_shared<URL>(
std::move(file));
88 void set_line(
int line)
noexcept {
92 void set_column(
int column)
noexcept {
97 _line = line_and_column.first - 1;
98 _column = line_and_column.second - 1;
101 void increment_column() noexcept {
105 void tab_column() noexcept {
111 void increment_line() noexcept {
120 _column = ((_column / 8) + 1) * 8;
144 while (ttlet c = *s++) {
151 if (location._line == 0) {
152 _column += location._column;
154 _line += location._line;
155 _column = location._column;
161 return fmt::format(
"{0}:{1}:{2}", l.file(), l.line(), l.column());