diff options
Diffstat (limited to 'server/src/matcher/definition.lua')
-rw-r--r-- | server/src/matcher/definition.lua | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/server/src/matcher/definition.lua b/server/src/matcher/definition.lua index 57e4b237..13015cac 100644 --- a/server/src/matcher/definition.lua +++ b/server/src/matcher/definition.lua @@ -4,31 +4,29 @@ local function parseResult(result) local positions = {} local tp = result.type if tp == 'local' then - for _, info in ipairs(result.object) do + for _, info in ipairs(result) do if info.type == 'local' then positions[#positions+1] = {info.source.start, info.source.finish} end end elseif tp == 'field' then - for _, info in ipairs(result.object) do + for _, info in ipairs(result) do if info.type == 'set' then positions[#positions+1] = {info.source.start, info.source.finish} end end elseif tp == 'label' then - for _, info in ipairs(result.object) do + for _, info in ipairs(result) do if info.type == 'set' then positions[#positions+1] = {info.source.start, info.source.finish} end end - else - error('Unknow result type:' .. result.type) end return positions end return function (vm, pos) - local result = findResult(vm.results, pos) + local result = findResult(vm, pos) if not result then return nil end |