summaryrefslogtreecommitdiff
path: root/server/src/vm/vm.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-02-26 17:10:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-02-26 17:10:36 +0800
commitfaead2bc3d7699666279974692a55b71423f07c3 (patch)
tree9fa7ca6c234b34d6bb8b5ae71e88a6bedc4a73d9 /server/src/vm/vm.lua
parent18694a6c3453206c453c41c0da0bcf4e4d62c8f7 (diff)
downloadlua-language-server-faead2bc3d7699666279974692a55b71423f07c3.zip
修正bug
Diffstat (limited to 'server/src/vm/vm.lua')
-rw-r--r--server/src/vm/vm.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua
index d8905538..049294dd 100644
--- a/server/src/vm/vm.lua
+++ b/server/src/vm/vm.lua
@@ -360,6 +360,7 @@ function mt:getName(name, source)
return global
else
global = self:createValue('any')
+ ENVValue:setChild(name, global)
return global
end
end
@@ -723,12 +724,13 @@ function mt:setOne(var, value)
value = createValue('nil')
end
self:instantSource(var)
- var:bindValue(value, 'set')
if var.type == 'name' then
self:setName(var[1], var, value)
+ var:bindValue(value, 'set')
elseif var.type == 'simple' then
local parent = self:getSimple(var, -2)
local key = var[#var]
+ self:instantSource(key)
if key.type == 'index' then
local index = self:getIndex(key[1])
parent:setChild(index, value)
@@ -736,6 +738,7 @@ function mt:setOne(var, value)
local index = key[1]
parent:setChild(index, value)
end
+ key:bindValue(value, 'set')
end
end