blob: e6e5ffe10ff452d9ae43ad4a0ac695de8c1e4e91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
local guide = require 'parser.guide'
local m = {}
function m:value(source, callback)
local vararg = source.vararg
if vararg.type == 'call' then
local func = vararg.node
if self:getSpecialName(func) == 'setmetatable' then
local t, mt = self:callArgOf(vararg)
self:eachValue(t, callback)
self:eachField(mt, 's|__index', function (src, mode)
if mode == 'set' then
self:eachValue(src, callback)
end
end)
end
end
end
return m
|