diff options
Diffstat (limited to 'server-beta/src/searcher-old/method.lua')
-rw-r--r-- | server-beta/src/searcher-old/method.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/server-beta/src/searcher-old/method.lua b/server-beta/src/searcher-old/method.lua new file mode 100644 index 00000000..c05fba76 --- /dev/null +++ b/server-beta/src/searcher-old/method.lua @@ -0,0 +1,37 @@ +local guide = require 'parser.guide' + +local m = {} + +function m:eachDef(source, callback) + local node = source.parent.node + local key = guide.getKeyName(source) + self:eachField(node, key, function (info) + if info.mode == 'set' then + callback(info) + end + end) +end + +function m:eachRef(source, callback) + local node = source.parent.node + local key = guide.getKeyName(source) + self:eachField(node, key, function (info) + if info.mode == 'set' or info.mode == 'get' then + callback(info) + end + end) +end + +function m:eachField(source, key, callback) + self:eachField(source.parent, key, callback) +end + +function m:eachValue(source, callback) + self:eachValue(source.parent, callback) +end + +function m:getValue(source) + return self:getValue(source.parent) +end + +return m |