summaryrefslogtreecommitdiff
path: root/server-beta/src/searcher-old/string.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/searcher-old/string.lua')
-rw-r--r--server-beta/src/searcher-old/string.lua43
1 files changed, 43 insertions, 0 deletions
diff --git a/server-beta/src/searcher-old/string.lua b/server-beta/src/searcher-old/string.lua
new file mode 100644
index 00000000..94907116
--- /dev/null
+++ b/server-beta/src/searcher-old/string.lua
@@ -0,0 +1,43 @@
+local guide = require 'parser.guide'
+
+local m = {}
+
+function m:eachDef(source, callback)
+ local parent = source.parent
+ if not parent then
+ return
+ end
+ if parent.type ~= 'setindex' and parent.type ~= 'getindex' then
+ return
+ end
+ local node = 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 parent = source.parent
+ if not parent then
+ return
+ end
+ if parent.type ~= 'setindex' and parent.type ~= 'getindex' then
+ return
+ end
+ local node = 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:getValue(source, callback)
+ return source
+end
+
+return m