diff options
author | Li Jin <dragon-fly@qq.com> | 2023-05-18 10:10:08 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-05-18 10:10:17 +0800 |
commit | 78433df36c5b492f366ba57d852f5393b786cfff (patch) | |
tree | 3e553234305623b7ed55591e66669d730294835e | |
parent | f9eab26c8e9618c5cd9af87ed04d70ace2198e67 (diff) | |
download | yuescript-0.16.6.tar.gz yuescript-0.16.6.tar.bz2 yuescript-0.16.6.zip |
fix issue #134.v0.16.6
-rw-r--r-- | src/yuescript/yue_compiler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index e97ec9f..918ae2a 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
@@ -72,7 +72,7 @@ static std::unordered_set<std::string> Metamethods = { | |||
72 | "close"s // Lua 5.4 | 72 | "close"s // Lua 5.4 |
73 | }; | 73 | }; |
74 | 74 | ||
75 | const std::string_view version = "0.16.5"sv; | 75 | const std::string_view version = "0.16.6"sv; |
76 | const std::string_view extension = "yue"sv; | 76 | const std::string_view extension = "yue"sv; |
77 | 77 | ||
78 | class CompileError : public std::logic_error { | 78 | class CompileError : public std::logic_error { |
@@ -5074,7 +5074,7 @@ private: | |||
5074 | lua_pushlstring(L, str.c_str(), str.size()); | 5074 | lua_pushlstring(L, str.c_str(), str.size()); |
5075 | } // cur pcall macroFunc args... | 5075 | } // cur pcall macroFunc args... |
5076 | } | 5076 | } |
5077 | bool success = lua_pcall(L, (args ? static_cast<int>(args->size()) : 0) + 1, 2, 0) == 0; | 5077 | bool success = lua_pcall(L, (args ? static_cast<int>(args->size()) : 0), 1, 0) == 0; |
5078 | if (!success) { // cur err | 5078 | if (!success) { // cur err |
5079 | std::string err = lua_tostring(L, -1); | 5079 | std::string err = lua_tostring(L, -1); |
5080 | throw CompileError("failed to expand macro: "s + err, x); | 5080 | throw CompileError("failed to expand macro: "s + err, x); |