summaryrefslogtreecommitdiff
path: root/script/vm/compiler.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-01-09 21:04:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-01-09 21:04:12 +0800
commit084935667d60fd9f69b3390d70d09958dd84b078 (patch)
tree7cbedc678d72251bc80f25ee3ed3f9a90d93cb03 /script/vm/compiler.lua
parent158b94b3ed0ea5aa40ad6d3ff9b29b189bf4f4f3 (diff)
downloadlua-language-server-084935667d60fd9f69b3390d70d09958dd84b078.zip
stash
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r--script/vm/compiler.lua33
1 files changed, 20 insertions, 13 deletions
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'