diff --git a/src/Location.cpp b/src/Location.cpp index 6d88788..13971e0 100644 --- a/src/Location.cpp +++ b/src/Location.cpp @@ -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()