summaryrefslogtreecommitdiff
path: root/server-beta/src/searcher/table.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/searcher/table.lua')
-rw-r--r--server-beta/src/searcher/table.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/server-beta/src/searcher/table.lua b/server-beta/src/searcher/table.lua
new file mode 100644
index 00000000..26c499ed
--- /dev/null
+++ b/server-beta/src/searcher/table.lua
@@ -0,0 +1,33 @@
+local guide = require 'parser.guide'
+
+local m = {}
+
+function m:eachField(source, key, callback)
+ for i = 1, #source do
+ local src = source[i]
+ if key == guide.getKeyName(src) then
+ if src.type == 'tablefield' then
+ callback {
+ source = src,
+ uri = self.uri,
+ mode = 'set',
+ }
+ elseif src.type == 'tableindex' then
+ callback {
+ source = src,
+ uri = self.uri,
+ mode = 'set',
+ }
+ end
+ end
+ end
+end
+
+function m:eachValue(source, callback)
+ callback {
+ source = source,
+ uri = self.uri,
+ }
+end
+
+return m