summaryrefslogtreecommitdiff
path: root/server/src/matcher/definition.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/matcher/definition.lua')
-rw-r--r--server/src/matcher/definition.lua32
1 files changed, 2 insertions, 30 deletions
diff --git a/server/src/matcher/definition.lua b/server/src/matcher/definition.lua
index 3dc4f8ff..57e4b237 100644
--- a/server/src/matcher/definition.lua
+++ b/server/src/matcher/definition.lua
@@ -1,25 +1,5 @@
local findResult = require 'matcher.find_result'
-local function tryMeta(var)
- local keys = {}
- repeat
- if var.childs.meta then
- local metavar = var.childs.meta
- for i = #keys, 1, -1 do
- local key = keys[i]
- metavar = metavar.childs[key]
- if not metavar then
- return nil
- end
- end
- return metavar
- end
- keys[#keys+1] = var.key
- var = var.parent
- until not var
- return nil
-end
-
local function parseResult(result)
local positions = {}
local tp = result.type
@@ -35,14 +15,6 @@ local function parseResult(result)
positions[#positions+1] = {info.source.start, info.source.finish}
end
end
- --local metavar = tryMeta(var)
- --if metavar then
- -- for _, info in ipairs(metavar) do
- -- if info.type == 'set' then
- -- positions[#positions+1] = {info.source.start, --info.source.finish}
- -- end
- -- end
- --end
elseif tp == 'label' then
for _, info in ipairs(result.object) do
if info.type == 'set' then
@@ -55,8 +27,8 @@ local function parseResult(result)
return positions
end
-return function (results, pos)
- local result = findResult(results, pos)
+return function (vm, pos)
+ local result = findResult(vm.results, pos)
if not result then
return nil
end