summaryrefslogtreecommitdiff
path: root/server/src/vm/emmy.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-18 20:07:07 +0800
committersumneko <sumneko@hotmail.com>2019-04-18 20:07:07 +0800
commit92e1b16ba3e6749602f2ea2dcb64a73f11653caa (patch)
tree5feed39fa9ed5536dcfb38766fc58427f68d6348 /server/src/vm/emmy.lua
parent0680944ab40753dede0f3b7150b283db4715f502 (diff)
downloadlua-language-server-92e1b16ba3e6749602f2ea2dcb64a73f11653caa.zip
field支持 Emmy.class
Diffstat (limited to 'server/src/vm/emmy.lua')
-rw-r--r--server/src/vm/emmy.lua16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/src/vm/emmy.lua b/server/src/vm/emmy.lua
index 6e5c2b13..67c620a8 100644
--- a/server/src/vm/emmy.lua
+++ b/server/src/vm/emmy.lua
@@ -1,15 +1,29 @@
local mt = require 'vm.manager'
+function mt:clearEmmy()
+ self._emmy = nil
+end
+
+function mt:getEmmy()
+ local emmy = self._emmy
+ self._emmy = nil
+ return emmy
+end
+
function mt:doEmmyClass(action)
local emmyMgr = self.emmyMgr
self:instantSource(action)
local class = emmyMgr:addClass(action)
- self.emmy = class
+ self._emmy = class
action:set('emmy.class', class)
end
function mt:doEmmyType(action)
local emmyMgr = self.emmyMgr
+ self:instantSource(action)
+ local type = emmyMgr:createType()
+ self._emmy = type
+ action:set('emmy.type', type)
end
function mt:doEmmyIncomplete(action)