From 4209d5dd00303e21db2f78139244b7c0b6ac8a4d Mon Sep 17 00:00:00 2001 From: Li Jin Date: Thu, 12 Mar 2026 09:31:49 +0800 Subject: Fixed a little semantic issue. --- src/yuescript/yue_compiler.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 861c547..b9c9330 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp @@ -78,7 +78,7 @@ static std::unordered_set Metamethods = { "close"s // Lua 5.4 }; -const std::string_view version = "0.33.9"sv; +const std::string_view version = "0.33.10"sv; const std::string_view extension = "yue"sv; class CompileError : public std::logic_error { @@ -3759,7 +3759,6 @@ private: out.push_back(join(temp)); return; } - auto defs = getPreDefine(assignment); transformValue(leftValue, temp); auto left = std::move(temp.back()); temp.pop_back(); @@ -3769,11 +3768,13 @@ private: if (!singleValueFrom(update->value)) { right = '(' + right + ')'; } + auto defs = getPreDefine(assignment); _buf << join(temp); - if (!defs.empty()) + if (!defs.empty()) { _buf << defs; - else + } else { _buf << indent() << left; + } _buf << " = "sv << left << ' ' << op << ' ' << right << nl(assignment); out.push_back(clearBuf()); break; -- cgit v1.2.3-55-g6feb