From 3355b7c475bc4a3bc8c4f2e8a2f504bb3ccb9395 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Thu, 8 Apr 2021 09:35:09 +0800 Subject: fix issue #47. --- spec/inputs/string.yue | 7 +++++++ src/yuescript/yue_compiler.cpp | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/inputs/string.yue b/spec/inputs/string.yue index 5d8f772..e21ae84 100644 --- a/spec/inputs/string.yue +++ b/spec/inputs/string.yue @@ -26,6 +26,13 @@ hola = [===[ mm = [[well trhere]] +txt = [[ + + +nil +Fail to compile +]] + oo = "" x = "\\" diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 38456cc..6627189 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp @@ -59,7 +59,7 @@ inline std::string s(std::string_view sv) { return std::string(sv); } -const std::string_view version = "0.7.4"sv; +const std::string_view version = "0.7.5"sv; const std::string_view extension = "yue"sv; class YueCompilerImpl { @@ -4456,7 +4456,6 @@ private: void transformLuaString(LuaString_t* luaString, str_list& out) { auto content = _parser.toString(luaString->content); Utils::replace(content, "\r\n"sv, "\n"); - if (content[0] == '\n') content.erase(content.begin()); out.push_back(_parser.toString(luaString->open) + content + _parser.toString(luaString->close)); } -- cgit v1.2.3-55-g6feb