summaryrefslogtreecommitdiff
path: root/server/src/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-08 15:08:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-08 15:08:00 +0800
commit0af858e47af3cfc71bc3294f849108b5c00d0b11 (patch)
tree39d56fee462f6ac221096788968550f73813edc8 /server/src/vm
parentbffb7b50e3c7cea0a0a2e08e3efee8acc83eb7bf (diff)
downloadlua-language-server-0af858e47af3cfc71bc3294f849108b5c00d0b11.zip
修正一些bug
Diffstat (limited to 'server/src/vm')
-rw-r--r--server/src/vm/vm.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua
index 50deb7e9..9e89c6e6 100644
--- a/server/src/vm/vm.lua
+++ b/server/src/vm/vm.lua
@@ -311,6 +311,7 @@ function mt:call(value, values, source)
if not func then
return
end
+ self:instantSource(source)
if lib then
self:callLibrary(func, values, source, lib)
else
@@ -437,8 +438,11 @@ function mt:unpackList(list)
end
function mt:getFirstInMulti(multi)
+ if not multi then
+ return multi
+ end
if multi.type == 'multi' then
- return multi[1]
+ return self:getFirstInMulti(multi[1])
else
return multi
end
@@ -449,6 +453,7 @@ function mt:getSimple(simple, max)
local first = simple[1]
self:instantSource(first)
local value = self:getExp(first)
+ value = self:getFirstInMulti(value) or createValue('nil')
first:bindValue(value, 'get')
if not max then
max = #simple