summaryrefslogtreecommitdiff
path: root/src/matcher/definition.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-11-19 17:19:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-11-19 17:19:29 +0800
commit229dfbac9f2b97c8aca3c565504d3aa0e99d5ab5 (patch)
tree0db530051b608b534d67d4556e9141acaf36b3be /src/matcher/definition.lua
parente8bcd1e80e9bed525f5515df0ce89516de37c51a (diff)
downloadlua-language-server-229dfbac9f2b97c8aca3c565504d3aa0e99d5ab5.zip
尽量不要创建表
Diffstat (limited to 'src/matcher/definition.lua')
-rw-r--r--src/matcher/definition.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/matcher/definition.lua b/src/matcher/definition.lua
index 3168fcf1..2054afc3 100644
--- a/src/matcher/definition.lua
+++ b/src/matcher/definition.lua
@@ -6,6 +6,8 @@ local scopes
local result
local namePos
+local DUMMY_TABLE = {}
+
local function getResult(name, p)
result = {name, p}
end
@@ -75,6 +77,20 @@ function defs.LocalSet(names)
end
end
+function defs.ArgList(...)
+ if ... == '' then
+ return DUMMY_TABLE
+ end
+ return {...}
+end
+
+function defs.FuncName(...)
+ if ... == '' then
+ return DUMMY_TABLE
+ end
+ return {...}
+end
+
function defs.FunctionDef(names, args)
if #names == 1 then
scopeSet(names[1])