From 5febd3a533762920ab4085fc8d3494fd64b3a6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 12 Jan 2023 17:09:13 +0800 Subject: fix --- script/vm/compiler.lua | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'script/vm/compiler.lua') diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index b4378a98..f3366958 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -239,7 +239,7 @@ local searchFieldSwitch = util.switch() : case 'global' : call(function (suri, node, key, pushResult) if node.cate == 'variable' then - if key then + if key ~= vm.ANY then if type(key) ~= 'string' then return end @@ -1267,25 +1267,13 @@ local compilerSwitch = util.switch() end end else - if guide.isGet(source) then - --local node = vm.traceNode(source) - --if node then - -- vm.setNode(source, node) - --end - ---@cast key string - vm.compileByParentNode(source.node, key, function (src) - vm.setNode(source, vm.compileNode(src)) - end) - else - ---@cast key string - if source.value then - vm.setNode(source, vm.compileNode(source.value)) - else - vm.compileByParentNode(source.node, key, function (src) - vm.setNode(source, vm.compileNode(src)) - end) + ---@cast key string + vm.compileByParentNode(source.node, key, function (src) + vm.setNode(source, vm.compileNode(src)) + if src.value then + vm.setNode(source, vm.compileNode(src.value)) end - end + end) end end) : case 'setglobal' -- cgit v1.2.3