summaryrefslogtreecommitdiff
path: root/server/src/vm
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-07 14:28:50 +0800
committersumneko <sumneko@hotmail.com>2019-05-07 14:28:50 +0800
commit717729c33ce10067aac8afddd2fc2a5da9d801b5 (patch)
tree9abcc4b9f809372aa9c031f4f9f0087a2c567d91 /server/src/vm
parenta2c3b5915949daf39ddf6f044dbc1a5a64ae9847 (diff)
downloadlua-language-server-717729c33ce10067aac8afddd2fc2a5da9d801b5.zip
外部判空
Diffstat (limited to 'server/src/vm')
-rw-r--r--server/src/vm/emmy.lua2
-rw-r--r--server/src/vm/function.lua2
-rw-r--r--server/src/vm/ipairs.lua8
3 files changed, 6 insertions, 6 deletions
diff --git a/server/src/vm/emmy.lua b/server/src/vm/emmy.lua
index 4ecef4d3..32c21e45 100644
--- a/server/src/vm/emmy.lua
+++ b/server/src/vm/emmy.lua
@@ -271,7 +271,7 @@ function mt:doEmmyFunctionType(action)
local emmyMgr = self.emmyMgr
self:instantSource(action)
local funcObj = emmyMgr:addFunctionType(action)
- ---@type function
+ ---@type emmyFunction
local func = functionMgr.create(action)
for i = 1, #action // 2 do
local nameSource = action[i*2-1]
diff --git a/server/src/vm/function.lua b/server/src/vm/function.lua
index 593d40dd..1ba49f9c 100644
--- a/server/src/vm/function.lua
+++ b/server/src/vm/function.lua
@@ -6,7 +6,7 @@ local listMgr = require 'vm.list'
local Watch = setmetatable({}, {__mode = 'kv'})
----@class function
+---@class emmyFunction
local mt = {}
mt.__index = mt
mt.type = 'function'
diff --git a/server/src/vm/ipairs.lua b/server/src/vm/ipairs.lua
index b8d821ef..58c7d827 100644
--- a/server/src/vm/ipairs.lua
+++ b/server/src/vm/ipairs.lua
@@ -1,12 +1,12 @@
local mt = require 'vm.manager'
----@param func function
+---@param func emmyFunction
function mt:callIpairs(func, values, source)
local tbl = values[1]
func:setReturn(2, tbl)
end
----@param func function
+---@param func emmyFunction
function mt:callAtIpairs(func, values, source)
local tbl = values[1]
if tbl then
@@ -20,13 +20,13 @@ function mt:callAtIpairs(func, values, source)
end
end
----@param func function
+---@param func emmyFunction
function mt:callPairs(func, values, source)
local tbl = values[1]
func:setReturn(2, tbl)
end
----@param func function
+---@param func emmyFunction
function mt:callNext(func, values, source)
local tbl = values[1]
if tbl then