diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-01-12 17:09:13 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-01-12 17:09:13 +0800 |
commit | 5febd3a533762920ab4085fc8d3494fd64b3a6bb (patch) | |
tree | 8e33872e0b746647f5cfbbe9992c53d435aac0e7 | |
parent | c186963827f82456cfa2b177b109029df1edb44c (diff) | |
download | lua-language-server-5febd3a533762920ab4085fc8d3494fd64b3a6bb.zip |
fix
-rw-r--r-- | script/vm/compiler.lua | 26 |
1 files changed, 7 insertions, 19 deletions
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' |