diff options
Diffstat (limited to 'server-beta/src/seacher/field.lua')
-rw-r--r-- | server-beta/src/seacher/field.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/server-beta/src/seacher/field.lua b/server-beta/src/seacher/field.lua new file mode 100644 index 00000000..72e8ab59 --- /dev/null +++ b/server-beta/src/seacher/field.lua @@ -0,0 +1,34 @@ +local guide = require 'parser.guide' +local checkSMT = require 'seacher.setmetatable' + +local m = {} + +function m:eachDef(source, callback) + local parent = source.parent + local key = guide.getKeyName(source) + self:eachField(parent, key, function (src, mode) + if mode == 'set' then + callback(src, mode) + end + end) +end + +function m:eachRef(source, callback) + local parent = source.parent + local key = guide.getKeyName(source) + self:eachField(parent, key, function (src, mode) + if mode == 'set' or mode == 'set' then + callback(src, mode) + 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 + +return m |