summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/emmy/manager.lua2
-rw-r--r--server/src/parser/ast.lua16
2 files changed, 14 insertions, 4 deletions
diff --git a/server/src/emmy/manager.lua b/server/src/emmy/manager.lua
index 658fb56b..9b6978b9 100644
--- a/server/src/emmy/manager.lua
+++ b/server/src/emmy/manager.lua
@@ -147,7 +147,7 @@ function mt:addParam(source, bind)
paramObj:bindGeneric(bind)
else
paramObj:bindType(bind)
- self:eachClass(bind:getName(), function (class)
+ self:eachClass(bind:getType(), function (class)
if class.type == 'emmy.alias' then
class:eachEnum(function (enum)
paramObj:addEnum(enum)
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua
index f2486fd6..e307f8b8 100644
--- a/server/src/parser/ast.lua
+++ b/server/src/parser/ast.lua
@@ -2,6 +2,7 @@ local tonumber = tonumber
local string_char = string.char
local utf8_char = utf8.char
local type = type
+local table = table
local Errs
local State
@@ -625,6 +626,15 @@ local Defs = {
if obj.argFinish > obj.finish then
obj.argFinish = obj.finish
end
+
+ if name.type ~= 'name' then
+ pushError {
+ type = 'UNEXPECT_LFUNC_NAME',
+ start = name.start,
+ finish = name.finish,
+ }
+ end
+
return obj
end,
Table = function (start, ...)
@@ -696,10 +706,10 @@ local Defs = {
local last = list[#list]
list.finish = last.finish
return list
- elseif first == '' then
- return nil
- else
+ elseif type(first) == 'table' then
return first
+ else
+ return nil
end
end,
ArgList = function (...)