diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-11-19 17:19:29 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-11-19 17:19:29 +0800 |
commit | 229dfbac9f2b97c8aca3c565504d3aa0e99d5ab5 (patch) | |
tree | 0db530051b608b534d67d4556e9141acaf36b3be /src/matcher/definition.lua | |
parent | e8bcd1e80e9bed525f5515df0ce89516de37c51a (diff) | |
download | lua-language-server-229dfbac9f2b97c8aca3c565504d3aa0e99d5ab5.zip |
尽量不要创建表
Diffstat (limited to 'src/matcher/definition.lua')
-rw-r--r-- | src/matcher/definition.lua | 16 |
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]) |