aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-04-20 09:19:59 +0800
committerLi Jin <dragon-fly@qq.com>2022-04-20 09:19:59 +0800
commit53bd5a32e30493f4915e79bfb63b1eec846f1a7f (patch)
treec8a3378538518e3eacd9bc6c8fda924012d644d3 /src
parentba1081a851dd6b3c76be5ad8bb9cb7fd643fc792 (diff)
downloadyuescript-53bd5a32e30493f4915e79bfb63b1eec846f1a7f.tar.gz
yuescript-53bd5a32e30493f4915e79bfb63b1eec846f1a7f.tar.bz2
yuescript-53bd5a32e30493f4915e79bfb63b1eec846f1a7f.zip
add placeholder support for list destructuring. fix part of issue #93.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/yuescript/yue_compiler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp
index e7da2dd..17fbaf6 100755
--- a/src/yuescript/yue_compiler.cpp
+++ b/src/yuescript/yue_compiler.cpp
@@ -60,7 +60,7 @@ using namespace parserlib;
60 60
61typedef std::list<std::string> str_list; 61typedef std::list<std::string> str_list;
62 62
63const std::string_view version = "0.10.11"sv; 63const std::string_view version = "0.10.12"sv;
64const std::string_view extension = "yue"sv; 64const std::string_view extension = "yue"sv;
65 65
66class YueCompilerImpl { 66class YueCompilerImpl {
@@ -1597,6 +1597,7 @@ private:
1597 _config.lintGlobalVariable = false; 1597 _config.lintGlobalVariable = false;
1598 auto exp = static_cast<Exp_t*>(pair); 1598 auto exp = static_cast<Exp_t*>(pair);
1599 auto varName = singleVariableFrom(exp); 1599 auto varName = singleVariableFrom(exp);
1600 if (varName == "_"sv) break;
1600 bool isVariable = !varName.empty(); 1601 bool isVariable = !varName.empty();
1601 if (!isVariable) { 1602 if (!isVariable) {
1602 str_list temp; 1603 str_list temp;