From afb046316a15a2c3702b1f056456b58e9356e693 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Thu, 15 Jan 2026 17:54:59 +0800 Subject: Added const attributes. --- src/yuescript/yue_compiler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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: } } if (auto importedGlobal = currentScope().importedGlobal.get()) { + int target = getLuaTarget(block); + auto attrib = target >= 504 ? " "s : Empty; str_list globalCodes; for (const auto& global : importedGlobal->globalList) { - globalCodes.emplace_back(importedGlobal->indent + "local "s + global + " = "s + global + importedGlobal->nl); + globalCodes.emplace_back(importedGlobal->indent + "local "s + global + attrib + " = "s + global + importedGlobal->nl); } *importedGlobal->globalCodeLine = join(globalCodes); _importedGlobal = nullptr; -- cgit v1.2.3-55-g6feb