diff options
Diffstat (limited to '')
| -rw-r--r-- | src/yuescript/yue_compiler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index f4b4330..a566fae 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.1"sv; | 75 | const std::string_view version = "0.16.2"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 { |
| @@ -2523,6 +2523,9 @@ private: | |||
| 2523 | for (auto i = exprs.begin(), j = values.begin(); i != exprs.end(); ++i, ++j) { | 2523 | for (auto i = exprs.begin(), j = values.begin(); i != exprs.end(); ++i, ++j) { |
| 2524 | auto expr = *i; | 2524 | auto expr = *i; |
| 2525 | auto value = singleValueFrom(expr); | 2525 | auto value = singleValueFrom(expr); |
| 2526 | if (!value) { | ||
| 2527 | throw CompileError("invalid destructure"sv, expr); | ||
| 2528 | } | ||
| 2526 | ast_node* destructNode = value->getByPath<SimpleValue_t, TableLit_t>(); | 2529 | ast_node* destructNode = value->getByPath<SimpleValue_t, TableLit_t>(); |
| 2527 | if (destructNode || (destructNode = value->item.as<SimpleTable_t>())) { | 2530 | if (destructNode || (destructNode = value->item.as<SimpleTable_t>())) { |
| 2528 | if (*j != nil) { | 2531 | if (*j != nil) { |
