diff options
Diffstat (limited to 'src/yuescript/yue_parser.cpp')
-rw-r--r-- | src/yuescript/yue_parser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index 99fea0a..dffdbe1 100644 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp | |||
@@ -976,7 +976,7 @@ void trim(std::string& str) { | |||
976 | } | 976 | } |
977 | } // namespace Utils | 977 | } // namespace Utils |
978 | 978 | ||
979 | std::string ParseInfo::errorMessage(std::string_view msg, int errLine, int errCol) const { | 979 | std::string ParseInfo::errorMessage(std::string_view msg, int errLine, int errCol, int lineOffset) const { |
980 | const int ASCII = 255; | 980 | const int ASCII = 255; |
981 | int length = errLine; | 981 | int length = errLine; |
982 | auto begin = codes->begin(); | 982 | auto begin = codes->begin(); |
@@ -1009,7 +1009,7 @@ std::string ParseInfo::errorMessage(std::string_view msg, int errLine, int errCo | |||
1009 | } | 1009 | } |
1010 | Utils::replace(line, "\t"sv, " "sv); | 1010 | Utils::replace(line, "\t"sv, " "sv); |
1011 | std::ostringstream buf; | 1011 | std::ostringstream buf; |
1012 | buf << errLine << ": "sv << msg << '\n' | 1012 | buf << errLine + lineOffset << ": "sv << msg << '\n' |
1013 | << line << '\n' | 1013 | << line << '\n' |
1014 | << std::string(col, ' ') << "^"sv; | 1014 | << std::string(col, ' ') << "^"sv; |
1015 | return buf.str(); | 1015 | return buf.str(); |