diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-28 18:03:14 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-28 18:03:14 +0800 |
| commit | 29db60797bd74656b57a0f20778c76adc78095ac (patch) | |
| tree | e7e54bb45011bb1dc5ba159c80dfffd396a61eed /src | |
| parent | 394ee0f64a0dc022f1dab86213d4771982ecf987 (diff) | |
| download | yuescript-29db60797bd74656b57a0f20778c76adc78095ac.tar.gz yuescript-29db60797bd74656b57a0f20778c76adc78095ac.tar.bz2 yuescript-29db60797bd74656b57a0f20778c76adc78095ac.zip | |
Fixed destructuring with empty and comment lines in table issue. Updated docs.v0.33.7
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuescript/yue_compiler.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 10fd5d6..514b6f2 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.33.6"sv; | 81 | const std::string_view version = "0.33.7"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 { |
| @@ -3028,6 +3028,9 @@ private: | |||
| 3028 | auto subMetaDestruct = node->new_ptr<TableLit_t>(); | 3028 | auto subMetaDestruct = node->new_ptr<TableLit_t>(); |
| 3029 | for (auto pair : *tableItems) { | 3029 | for (auto pair : *tableItems) { |
| 3030 | switch (pair->get_id()) { | 3030 | switch (pair->get_id()) { |
| 3031 | case id<YueComment_t>(): | ||
| 3032 | case id<EmptyLine_t>(): | ||
| 3033 | break; | ||
| 3031 | case id<Exp_t>(): | 3034 | case id<Exp_t>(): |
| 3032 | case id<NormalDef_t>(): { | 3035 | case id<NormalDef_t>(): { |
| 3033 | ++index; | 3036 | ++index; |
| @@ -3429,6 +3432,9 @@ private: | |||
| 3429 | } | 3432 | } |
| 3430 | for (auto item : *dlist) { | 3433 | for (auto item : *dlist) { |
| 3431 | switch (item->get_id()) { | 3434 | switch (item->get_id()) { |
| 3435 | case id<YueComment_t>(): | ||
| 3436 | case id<EmptyLine_t>(): | ||
| 3437 | break; | ||
| 3432 | case id<MetaVariablePairDef_t>(): { | 3438 | case id<MetaVariablePairDef_t>(): { |
| 3433 | auto mvp = static_cast<MetaVariablePairDef_t*>(item); | 3439 | auto mvp = static_cast<MetaVariablePairDef_t*>(item); |
| 3434 | auto mp = mvp->pair.get(); | 3440 | auto mp = mvp->pair.get(); |
