summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-24 22:50:10 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-24 22:50:10 +0800
commitd97a214819c9eba27bf3d836888e4cb315bd5d23 (patch)
treeac2dc713d9c3d1f798b7af1273ef79c242083cb2 /script/vm
parent943ba62782d8eed159c1b548c2718db228afc1a8 (diff)
downloadlua-language-server-d97a214819c9eba27bf3d836888e4cb315bd5d23.zip
fix
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index ec3b28bc..c38d1450 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -887,7 +887,7 @@ local function compileLocal(source)
-- for x = ... do
if source.parent.type == 'loop' then
- vm.setNode(source, globalMgr.getGlobal('type', 'integer'))
+ vm.compileNode(source.parent)
end
if source.bindDocs then
@@ -1246,6 +1246,12 @@ local compilerSwitch = util.switch()
end
end
end)
+ : case 'loop'
+ : call(function (source)
+ if source.loc then
+ vm.setNode(source.loc, globalMgr.getGlobal('type', 'integer'))
+ end
+ end)
: case 'doc.type'
: call(function (source)
for _, typeUnit in ipairs(source.types) do