Location: Rewrite str and paren_str

This commit is contained in:
apio 2022-08-25 20:10:13 +02:00
parent a9a21b19e0
commit 59a80100db

View File

@ -12,14 +12,12 @@ Location::~Location()
std::string Location::str() const
{
std::ostringstream ss;
ss << fname << ":" << line << ":" << column;
return ss.str();
return format_string("%s:%d:%d", fname, line, column);
}
std::string Location::paren_str() const
{
return format_string("(%s)", this->str());
return format_string("(%s:%d:%d)", fname, line, column);
}
void Location::advance()