diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-06-14 15:56:54 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-06-14 15:56:54 +0800 |
| commit | 7bb66616ff5a6d3f6f3b35c68fa9a908af034884 (patch) | |
| tree | bafcccb4552eaa34405759792c33b1df9df6ae59 /src | |
| parent | b24f516c4374016c2662b12426c94d95827bf98a (diff) | |
| download | yuescript-7bb66616ff5a6d3f6f3b35c68fa9a908af034884.tar.gz yuescript-7bb66616ff5a6d3f6f3b35c68fa9a908af034884.tar.bz2 yuescript-7bb66616ff5a6d3f6f3b35c68fa9a908af034884.zip | |
Sync YueScript compiler updates
Diffstat (limited to 'src')
| -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 844d61e..df260ab 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
| @@ -78,7 +78,7 @@ static std::unordered_set<std::string> Metamethods = { | |||
| 78 | "close"s // Lua 5.4 | 78 | "close"s // Lua 5.4 |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | const std::string_view version = "0.34.0"sv; | 81 | const std::string_view version = "0.34.1"sv; |
| 82 | const std::string_view extension = "yue"sv; | 82 | const std::string_view extension = "yue"sv; |
| 83 | 83 | ||
| 84 | class CompileError : public std::logic_error { | 84 | class CompileError : public std::logic_error { |
| @@ -4786,7 +4786,7 @@ private: | |||
| 4786 | auto newBlock = funLit->new_ptr<Block_t>(); | 4786 | auto newBlock = funLit->new_ptr<Block_t>(); |
| 4787 | if (funLit->body) { | 4787 | if (funLit->body) { |
| 4788 | auto last = lastStatementFrom(funLit->body); | 4788 | auto last = lastStatementFrom(funLit->body); |
| 4789 | if (!last->appendix && last->content.is<Return_t>() && !funLit->defaultReturn.is<DefaultValue_t>()) { | 4789 | if (last && !last->appendix && last->content.is<Return_t>() && !funLit->defaultReturn.is<DefaultValue_t>()) { |
| 4790 | throw CompileError("duplicated return statement", last->content); | 4790 | throw CompileError("duplicated return statement", last->content); |
| 4791 | } | 4791 | } |
| 4792 | auto content = funLit->body->content.get(); | 4792 | auto content = funLit->body->content.get(); |
