From 7270e0ba24884a705281c1fb99e1979955a5f33b Mon Sep 17 00:00:00 2001 From: MihailRis Date: Thu, 9 May 2024 18:52:46 +0300 Subject: [PATCH] parsing error log fix --- src/coders/commons.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/coders/commons.cpp b/src/coders/commons.cpp index 1f1b38a4..50538a50 100644 --- a/src/coders/commons.cpp +++ b/src/coders/commons.cpp @@ -20,14 +20,15 @@ parsing_error::parsing_error( std::string_view source, uint pos, uint line, - uint linestart) - : std::runtime_error(message), filename(filename), - pos(pos), line(line), linestart(linestart) { - size_t end = source.find("\n", linestart); + uint linestart +) : std::runtime_error(message), filename(filename), + pos(pos), line(line), linestart(linestart) +{ + size_t end = source.find("\n", linestart); if (end == std::string::npos) { end = source.length(); } - source = source.substr(linestart, end-linestart); + this->source = source.substr(linestart, end-linestart); } std::string parsing_error::errorLog() const {