From 4248038716c6c2281a10af9c0a3f04c6468b1946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 23 Oct 2019 17:31:02 +0800 Subject: =?UTF-8?q?=E5=87=86=E5=A4=87=E6=8D=A2=E4=B8=80=E4=B8=AA=E5=86=99?= =?UTF-8?q?=E6=B3=95=E8=AF=95=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/src/searcher-old/table.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 server-beta/src/searcher-old/table.lua (limited to 'server-beta/src/searcher-old/table.lua') diff --git a/server-beta/src/searcher-old/table.lua b/server-beta/src/searcher-old/table.lua new file mode 100644 index 00000000..fa9a064a --- /dev/null +++ b/server-beta/src/searcher-old/table.lua @@ -0,0 +1,30 @@ +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:getValue(source) + return source +end + +return m -- cgit v1.2.3