fix: location stringification

This commit is contained in:
TopchetoEU 2022-10-11 14:38:14 +03:00
parent febae7df7f
commit 349bcc462c

View File

@ -11,17 +11,17 @@ std::string location_t::to_string() const {
res << filename; res << filename;
written_anything = true; written_anything = true;
} }
if (line != -1u) { if (line + 1 != 0) {
if (written_anything) res << ':'; if (written_anything) res << ':';
res << line + 1; res << line + 1;
written_anything = true; written_anything = true;
} }
if (start != -1u) { if (start + 1 != 0) {
if (written_anything) res << ':'; if (written_anything) res << ':';
res << start + 1; res << start + 1;
written_anything = true; written_anything = true;
} }
if (length != -1u) { if (length + 1 != 0) {
if (written_anything) res << '(' << length << ')'; if (written_anything) res << '(' << length << ')';
written_anything = true; written_anything = true;
} }