diff options
author | Li Jin <dragon-fly@qq.com> | 2021-02-17 12:17:44 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2021-02-17 12:17:44 +0800 |
commit | f19ba3e5ba71adf8092252bac21381ba75870792 (patch) | |
tree | e6b04ce0a636ab21759a56f7e4f6752038b001b9 /src | |
parent | 7066392d1c974065181d95d93274136dcd625d43 (diff) | |
download | yuescript-f19ba3e5ba71adf8092252bac21381ba75870792.tar.gz yuescript-f19ba3e5ba71adf8092252bac21381ba75870792.tar.bz2 yuescript-f19ba3e5ba71adf8092252bac21381ba75870792.zip |
fix macro issue.
Diffstat (limited to 'src')
-rw-r--r-- | src/yuescript/yue_compiler.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 22311f4..4917e4e 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) { | |||
58 | return std::string(sv); | 58 | return std::string(sv); |
59 | } | 59 | } |
60 | 60 | ||
61 | const std::string_view version = "0.6.5"sv; | 61 | const std::string_view version = "0.6.6"sv; |
62 | const std::string_view extension = "yue"sv; | 62 | const std::string_view extension = "yue"sv; |
63 | 63 | ||
64 | class YueCompilerImpl { | 64 | class YueCompilerImpl { |
@@ -593,6 +593,7 @@ private: | |||
593 | case id<ExpList_t>(): return static_cast<Exp_t*>(exportNode->target.to<ExpList_t>()->exprs.back()); | 593 | case id<ExpList_t>(): return static_cast<Exp_t*>(exportNode->target.to<ExpList_t>()->exprs.back()); |
594 | } | 594 | } |
595 | } | 595 | } |
596 | return nullptr; | ||
596 | } | 597 | } |
597 | case id<Local_t>(): { | 598 | case id<Local_t>(): { |
598 | if (auto localValues = static_cast<Local_t*>(stmt->content.get())->item.as<local_values_t>()) { | 599 | if (auto localValues = static_cast<Local_t*>(stmt->content.get())->item.as<local_values_t>()) { |
@@ -600,6 +601,7 @@ private: | |||
600 | return static_cast<Exp_t*>(expList->exprs.back()); | 601 | return static_cast<Exp_t*>(expList->exprs.back()); |
601 | } | 602 | } |
602 | } | 603 | } |
604 | return nullptr; | ||
603 | } | 605 | } |
604 | case id<Global_t>(): { | 606 | case id<Global_t>(): { |
605 | if (auto globalValues = static_cast<Global_t*>(stmt->content.get())->item.as<global_values_t>()) { | 607 | if (auto globalValues = static_cast<Global_t*>(stmt->content.get())->item.as<global_values_t>()) { |
@@ -607,6 +609,7 @@ private: | |||
607 | return static_cast<Exp_t*>(expList->exprs.back()); | 609 | return static_cast<Exp_t*>(expList->exprs.back()); |
608 | } | 610 | } |
609 | } | 611 | } |
612 | return nullptr; | ||
610 | } | 613 | } |
611 | } | 614 | } |
612 | return nullptr; | 615 | return nullptr; |
@@ -3318,7 +3321,7 @@ private: | |||
3318 | throw std::logic_error(_info.errorMessage(s("failed to expand macro: "sv) + err, x)); | 3321 | throw std::logic_error(_info.errorMessage(s("failed to expand macro: "sv) + err, x)); |
3319 | } // cur success res | 3322 | } // cur success res |
3320 | if (lua_toboolean(L, -2) == 0) { | 3323 | if (lua_toboolean(L, -2) == 0) { |
3321 | std::string err = lua_tostring(L, -2); | 3324 | std::string err = lua_tostring(L, -1); |
3322 | throw std::logic_error(_info.errorMessage(s("failed to expand macro: "sv) + err, x)); | 3325 | throw std::logic_error(_info.errorMessage(s("failed to expand macro: "sv) + err, x)); |
3323 | } | 3326 | } |
3324 | lua_remove(L, -2); // cur res | 3327 | lua_remove(L, -2); // cur res |