From 990abfb9e1a464b962471f559c9ccff225f62f39 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 2 Mar 2021 15:09:05 +0800 Subject: fix issue #40. --- src/yuescript/yue_compiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index b07a998..0e65ae9 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp @@ -58,7 +58,7 @@ inline std::string s(std::string_view sv) { return std::string(sv); } -const std::string_view version = "0.6.9"sv; +const std::string_view version = "0.6.10"sv; const std::string_view extension = "yue"sv; class YueCompilerImpl { @@ -957,7 +957,7 @@ private: } default: YUEE("AST node mismatch", content); break; } - if (statement->needSep && !out.back().empty()) { + if (statement->needSep && !out.empty() && !out.back().empty()) { auto index = std::string::npos; if (_config.reserveLineNumber) { index = out.back().rfind(" -- "sv); -- cgit v1.2.3-55-g6feb