summaryrefslogtreecommitdiff
path: root/server/src/vm/emmy.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-24 21:16:16 +0800
committersumneko <sumneko@hotmail.com>2019-04-24 21:16:16 +0800
commit669e20ef2cdfa8d7763f7e7bcd405986e665e526 (patch)
tree391a0ec38ffc144de1538590e3e190349f9f5582 /server/src/vm/emmy.lua
parent6daad9f42b8c3003a538a0667e5242536aa95eac (diff)
downloadlua-language-server-669e20ef2cdfa8d7763f7e7bcd405986e665e526.zip
更新emmyParam
Diffstat (limited to 'server/src/vm/emmy.lua')
-rw-r--r--server/src/vm/emmy.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/server/src/vm/emmy.lua b/server/src/vm/emmy.lua
index a2a38553..5406aab1 100644
--- a/server/src/vm/emmy.lua
+++ b/server/src/vm/emmy.lua
@@ -2,6 +2,7 @@ local mt = require 'vm.manager'
function mt:clearEmmy()
self._emmy = nil
+ self._emmyParams = nil
end
function mt:doEmmy(action)
@@ -13,6 +14,7 @@ function mt:doEmmy(action)
elseif tp == 'emmyAlias' then
self:doEmmyAlias(action)
elseif tp == 'emmyParam' then
+ self:doEmmyParam(action)
elseif tp == 'emmyReturn' then
elseif tp == 'emmyField' then
elseif tp == 'emmyGeneric' then
@@ -33,6 +35,19 @@ function mt:getEmmy()
return emmy
end
+function mt:addEmmyParam(param)
+ if not self._emmyParams then
+ self._emmyParams = {}
+ end
+ self._emmyParams[#self._emmyParams+1] = param
+end
+
+function mt:getEmmyParams()
+ local params = self._emmyParams
+ self._emmyParams = nil
+ return params
+end
+
function mt:doEmmyClass(action)
---@type emmyMgr
local emmyMgr = self.emmyMgr
@@ -83,6 +98,18 @@ function mt:doEmmyAlias(action)
end
end
+function mt:doEmmyParam(action)
+ ---@type emmyMgr
+ local emmyMgr = self.emmyMgr
+ self:instantSource(action)
+ self:instantSource(action[1])
+ local type = self:doEmmyType(action[2])
+ local param = emmyMgr:addParam(action, type)
+ action:set('emmy.param', param)
+ self._emmy = nil
+ self:addEmmyParam(param)
+end
+
function mt:doEmmyIncomplete(action)
self:instantSource(action)
end