From 084935667d60fd9f69b3390d70d09958dd84b078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 9 Jan 2023 21:04:12 +0800 Subject: stash --- script/vm/compiler.lua | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'script/vm/compiler.lua') diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index e301ee25..060a2173 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1252,22 +1252,29 @@ local compilerSwitch = util.switch() end end else - ---@cast key string - vm.compileByParentNode(source.node, key, function (src) - if src.value then - if bindDocs(src) then - vm.setNode(source, vm.compileNode(src)) - elseif src.value.type ~= 'nil' then - vm.setNode(source, vm.compileNode(src.value)) - local node = vm.getNode(src) - if node then - vm.setNode(source, node) + if guide.isAssign(source) then + ---@cast key string + vm.compileByParentNode(source.node, key, function (src) + if src.value then + if bindDocs(src) then + vm.setNode(source, vm.compileNode(src)) + elseif src.value.type ~= 'nil' then + vm.setNode(source, vm.compileNode(src.value)) + local node = vm.getNode(src) + if node then + vm.setNode(source, node) + end end + else + vm.setNode(source, vm.compileNode(src)) end - else - vm.setNode(source, vm.compileNode(src)) + end) + else + local node = vm.traceNode(source) + if node then + vm.setNode(source, node) end - end) + end end end) : case 'setglobal' -- cgit v1.2.3