From 59a80100db3db36088cab5b6ae36b9f344f1e477 Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 25 Aug 2022 20:10:13 +0200 Subject: [PATCH] Location: Rewrite str and paren_str --- src/Location.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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()