summaryrefslogtreecommitdiff
path: root/src/matcher
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-11-16 18:01:34 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-11-16 18:01:34 +0800
commitadc68dd8f4eefc08e04e78dc2cee2f2716558094 (patch)
treefb0da4eb0d8ddd5210f5cdef22f8617e910f5320 /src/matcher
parent01af236ec7a9a0cf7e0075fe9cfa2280380c0ed2 (diff)
downloadlua-language-server-adc68dd8f4eefc08e04e78dc2cee2f2716558094.zip
位置分开捕获
Diffstat (limited to 'src/matcher')
-rw-r--r--src/matcher/definition.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/matcher/definition.lua b/src/matcher/definition.lua
index 86ea400b..bf7457e7 100644
--- a/src/matcher/definition.lua
+++ b/src/matcher/definition.lua
@@ -4,6 +4,7 @@ local pos
local defs = {}
local scopes
local result
+local namePos
local function getResult(name, p)
result = {name, p}
@@ -44,9 +45,13 @@ local function checkDifinition(name, p)
getResult(name, scopeGet(name))
end
-function defs.Name(p, str)
- checkDifinition(str, p)
- return {str, p}
+function defs.NamePos(p)
+ namePos = p
+end
+
+function defs.Name(str)
+ checkDifinition(str, namePos)
+ return {str, namePos}
end
function defs.LocalVar(names)