summaryrefslogtreecommitdiff
path: root/server/src/emmy/class.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-18 11:42:45 +0800
committersumneko <sumneko@hotmail.com>2019-04-18 11:42:45 +0800
commit04c3ce15f1515b11e43e4630888e323c6372b409 (patch)
treecfd2659fdaac0499416f8bf1406641f35edd6cb2 /server/src/emmy/class.lua
parent1c0416baecc6db9720beb18d5abfc3b7ef33ffbe (diff)
downloadlua-language-server-04c3ce15f1515b11e43e4630888e323c6372b409.zip
emmy.class
Diffstat (limited to 'server/src/emmy/class.lua')
-rw-r--r--server/src/emmy/class.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/server/src/emmy/class.lua b/server/src/emmy/class.lua
new file mode 100644
index 00000000..69d731ee
--- /dev/null
+++ b/server/src/emmy/class.lua
@@ -0,0 +1,16 @@
+local mt = {}
+mt.__index = mt
+mt.type = 'emmy.class'
+
+function mt:getType()
+ return self._name
+end
+
+return function (class, parent)
+ local self = setmetatable({
+ name = class[1],
+ source = class.id,
+ parent = parent and parent.id,
+ })
+ return self
+end