diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-02-26 15:29:10 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-02-26 15:29:10 +0800 |
commit | 94a9de07f5042e18927ce996f151c846fca432f9 (patch) | |
tree | 2152f984a509242dd0ad2dd122d57bf518ab26f3 /server/src/vm/vm.lua | |
parent | ae9734ee608897b48c2f1ef730d30cc168377e31 (diff) | |
download | lua-language-server-94a9de07f5042e18927ce996f151c846fca432f9.zip |
暂存
Diffstat (limited to 'server/src/vm/vm.lua')
-rw-r--r-- | server/src/vm/vm.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index 62f057d2..3d53feee 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -450,6 +450,7 @@ function mt:getSimple(simple, max) local first = simple[1] self:instantSource(first) local value = self:getExp(first) + first:bindValue(value, 'get') if not max then max = #simple elseif max < 0 then @@ -472,8 +473,10 @@ function mt:getSimple(simple, max) local child = source[1] local index = self:getIndex(child) value = value:getChild(index) or createValue('any') + source:bindValue(value, 'get') elseif source.type == 'name' then value = value:getChild(source[1]) or createValue('any') + source:bindValue(value, 'get') elseif source.type == ':' then object = value elseif source.type == '.' then @@ -664,8 +667,8 @@ end function mt:getMultiByList(list) local multi = createMulti() - for _, exp in ipairs(list) do - multi:push(self:getExp(exp)) + for i, exp in ipairs(list) do + multi:push(self:getExp(exp), i == #list) end return multi end @@ -722,6 +725,7 @@ 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) elseif var.type == 'simple' then |