aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yuescript/yue_compiler.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp
index e79b857..09d0bd1 100644
--- a/src/yuescript/yue_compiler.cpp
+++ b/src/yuescript/yue_compiler.cpp
@@ -5380,9 +5380,11 @@ private:
5380 } 5380 }
5381 } 5381 }
5382 if (auto importedGlobal = currentScope().importedGlobal.get()) { 5382 if (auto importedGlobal = currentScope().importedGlobal.get()) {
5383 int target = getLuaTarget(block);
5384 auto attrib = target >= 504 ? " <const>"s : Empty;
5383 str_list globalCodes; 5385 str_list globalCodes;
5384 for (const auto& global : importedGlobal->globalList) { 5386 for (const auto& global : importedGlobal->globalList) {
5385 globalCodes.emplace_back(importedGlobal->indent + "local "s + global + " = "s + global + importedGlobal->nl); 5387 globalCodes.emplace_back(importedGlobal->indent + "local "s + global + attrib + " = "s + global + importedGlobal->nl);
5386 } 5388 }
5387 *importedGlobal->globalCodeLine = join(globalCodes); 5389 *importedGlobal->globalCodeLine = join(globalCodes);
5388 _importedGlobal = nullptr; 5390 _importedGlobal = nullptr;