From 1cf67220f86381d7cec1a88c30a1d0e37d6e2a63 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 14 Apr 2024 21:53:00 +0800 Subject: [PATCH] Update error.cpp --- src/error.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.cpp b/src/error.cpp index 9ec28988..269a25e7 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -26,7 +26,7 @@ namespace pkpy{ } std::pair SourceData::_get_line(int lineno) const { - if(lineno == -1) return {nullptr, nullptr}; + if(is_precompiled || lineno == -1) return {nullptr, nullptr}; lineno -= 1; if(lineno < 0) lineno = 0; const char* _start = line_starts[lineno]; @@ -40,7 +40,7 @@ namespace pkpy{ SStream ss; ss << " " << "File \"" << filename << "\", line " << lineno; if(!name.empty()) ss << ", in " << name; - if(!source.empty() && !is_precompiled){ + if(!is_precompiled){ ss << '\n'; std::pair pair = _get_line(lineno); Str line = "";