summaryrefslogtreecommitdiff
path: root/server-beta/src/core/method.lua
blob: 9217c4a3a409c1b13cd1db7d5fee5f38927a7148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local guide    = require 'parser.guide'

local m = {}

function m:def(source, callback)
    local node = source.parent.node
    local key = guide.getKeyName(source)
    self:eachField(node, key, 'def', callback)
end

function m:ref(source, callback)
    local node = source.parent.node
    local key = guide.getKeyName(source)
    self:eachField(node, key, 'ref', callback)
end

function m:field(source, callback)
    local node = source.parent.node
    local key = guide.getKeyName(source)
    self:eachField(node, key, 'field', callback)
end

return m