summaryrefslogtreecommitdiff
path: root/server/src/vm/function.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-05 21:27:34 +0800
committersumneko <sumneko@hotmail.com>2019-05-05 21:27:34 +0800
commitde0adfc8ee4561d7eb9c31e19fa5774ff7d999dd (patch)
tree1ce2b253a781a01d519a2ff6abb24d4d378c75b9 /server/src/vm/function.lua
parentc1902bfe0f61006bd9afae43c10ee6a25863e5f6 (diff)
downloadlua-language-server-de0adfc8ee4561d7eb9c31e19fa5774ff7d999dd.zip
emmyFunction
Diffstat (limited to 'server/src/vm/function.lua')
-rw-r--r--server/src/vm/function.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/server/src/vm/function.lua b/server/src/vm/function.lua
index 2322fa70..e605e1c9 100644
--- a/server/src/vm/function.lua
+++ b/server/src/vm/function.lua
@@ -349,15 +349,19 @@ function mt:findEmmyParamByName(name)
return nil
end
+function mt:addArg(name, source, value)
+ local loc = localMgr.create(name, source, value)
+ self:saveUpvalue(name, loc)
+ self.args[#self.args+1] = loc
+end
+
function mt:createArg(vm, arg)
vm:instantSource(arg)
arg:set('arg', self)
if arg.type == 'name' then
+ vm:instantSource(arg)
local value = valueMgr.create('nil', arg)
- local loc = localMgr.create(arg[1], arg, value)
- self:saveUpvalue(arg[1], loc)
- self.args[#self.args+1] = loc
-
+ self:addArg(arg[1], arg, value)
elseif arg.type == '...' then
self._dots = createMulti()
end