diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-11-19 17:11:20 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-11-19 17:11:20 +0800 |
commit | 2687363810809f350038acfab2f52f27a3dc51a2 (patch) | |
tree | ed90b24e07e5ce2ec3a096f3b2b459c1d677fb19 /src/matcher | |
parent | c28a101f62fe7a118baa3eeccf13839249cae760 (diff) | |
download | lua-language-server-2687363810809f350038acfab2f52f27a3dc51a2.zip |
支持参数
Diffstat (limited to 'src/matcher')
-rw-r--r-- | src/matcher/definition.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/matcher/definition.lua b/src/matcher/definition.lua index bf7457e7..b18e1a01 100644 --- a/src/matcher/definition.lua +++ b/src/matcher/definition.lua @@ -54,6 +54,15 @@ function defs.Name(str) return {str, namePos} end +function defs.DOTSPos(p) + namePos = p +end + +function defs.DOTS(str) + checkDifinition(str, namePos) + return {str, namePos} +end + function defs.LocalVar(names) for _, name in ipairs(names) do scopeSet(name) @@ -66,10 +75,13 @@ function defs.LocalSet(names) end end -function defs.FunctionDef(names) +function defs.FunctionDef(names, args) if #names == 1 then scopeSet(names[1]) end + for _, arg in ipairs(args) do + scopeSet(arg) + end scopePush() end |