diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-04-08 09:35:09 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-04-08 09:35:09 +0800 |
| commit | 3355b7c475bc4a3bc8c4f2e8a2f504bb3ccb9395 (patch) | |
| tree | 9615396a6eb8fde89e1ac543db60d5de54f6f317 | |
| parent | cecaec71883691f49a3e4d5fa8c0ff6fb1a38a4f (diff) | |
| download | yuescript-3355b7c475bc4a3bc8c4f2e8a2f504bb3ccb9395.tar.gz yuescript-3355b7c475bc4a3bc8c4f2e8a2f504bb3ccb9395.tar.bz2 yuescript-3355b7c475bc4a3bc8c4f2e8a2f504bb3ccb9395.zip | |
fix issue #47.
Diffstat (limited to '')
| -rw-r--r-- | spec/inputs/string.yue | 7 | ||||
| -rw-r--r-- | 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 = [===[ | |||
| 26 | 26 | ||
| 27 | mm = [[well trhere]] | 27 | mm = [[well trhere]] |
| 28 | 28 | ||
| 29 | txt = [[ | ||
| 30 | |||
| 31 | |||
| 32 | nil | ||
| 33 | Fail to compile | ||
| 34 | ]] | ||
| 35 | |||
| 29 | oo = "" | 36 | oo = "" |
| 30 | 37 | ||
| 31 | x = "\\" | 38 | 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) { | |||
| 59 | return std::string(sv); | 59 | return std::string(sv); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | const std::string_view version = "0.7.4"sv; | 62 | const std::string_view version = "0.7.5"sv; |
| 63 | const std::string_view extension = "yue"sv; | 63 | const std::string_view extension = "yue"sv; |
| 64 | 64 | ||
| 65 | class YueCompilerImpl { | 65 | class YueCompilerImpl { |
| @@ -4456,7 +4456,6 @@ private: | |||
| 4456 | void transformLuaString(LuaString_t* luaString, str_list& out) { | 4456 | void transformLuaString(LuaString_t* luaString, str_list& out) { |
| 4457 | auto content = _parser.toString(luaString->content); | 4457 | auto content = _parser.toString(luaString->content); |
| 4458 | Utils::replace(content, "\r\n"sv, "\n"); | 4458 | Utils::replace(content, "\r\n"sv, "\n"); |
| 4459 | if (content[0] == '\n') content.erase(content.begin()); | ||
| 4460 | out.push_back(_parser.toString(luaString->open) + content + _parser.toString(luaString->close)); | 4459 | out.push_back(_parser.toString(luaString->open) + content + _parser.toString(luaString->close)); |
| 4461 | } | 4460 | } |
| 4462 | 4461 | ||
