diff options
author | Li Jin <dragon-fly@qq.com> | 2022-07-29 09:00:17 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-07-29 09:00:17 +0800 |
commit | be7fabeef0b6de9b15c2ff34e95794d87042c3bd (patch) | |
tree | d7860e34ca53416902099c39b51a9e0f1651e53e /src | |
parent | c1a599fccfd3c37ad2afc743b2a49cc5290fcb9f (diff) | |
download | yuescript-0.14.4.tar.gz yuescript-0.14.4.tar.bz2 yuescript-0.14.4.zip |
fix not marking variables from `import from` statement to be const issue.v0.14.4
Diffstat (limited to '')
-rwxr-xr-x | 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 6213631..868bf90 100755 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
@@ -54,7 +54,7 @@ namespace yue { | |||
54 | 54 | ||
55 | typedef std::list<std::string> str_list; | 55 | typedef std::list<std::string> str_list; |
56 | 56 | ||
57 | const std::string_view version = "0.14.3"sv; | 57 | const std::string_view version = "0.14.4"sv; |
58 | const std::string_view extension = "yue"sv; | 58 | const std::string_view extension = "yue"sv; |
59 | 59 | ||
60 | class YueCompilerImpl { | 60 | class YueCompilerImpl { |
@@ -7043,7 +7043,10 @@ private: | |||
7043 | temp.push_back(indent() + "end"s + nlr(import)); | 7043 | temp.push_back(indent() + "end"s + nlr(import)); |
7044 | } | 7044 | } |
7045 | out.push_back(join(temp)); | 7045 | out.push_back(join(temp)); |
7046 | markDestructureConst(assignment); | 7046 | auto vars = getAssignVars(assignment); |
7047 | for (const auto& var : vars) { | ||
7048 | markVarConst(var); | ||
7049 | } | ||
7047 | } | 7050 | } |
7048 | 7051 | ||
7049 | std::string moduleNameFrom(ImportLiteral_t* literal) { | 7052 | std::string moduleNameFrom(ImportLiteral_t* literal) { |