summaryrefslogtreecommitdiff
path: root/script-beta/parser
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/parser')
-rw-r--r--script-beta/parser/guide.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 55aa339a..faa77745 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -1736,9 +1736,30 @@ function m.cleanResults(results)
end
end
+function m.getCache(status, obj, mode)
+ if not status.interface.cache then
+ return
+ end
+ if obj.type == 'getglobal'
+ or obj.type == 'setglobal' then
+ local name = m.getKeyName(obj)
+ return status.interface.cache(name, mode)
+ else
+ return status.interface.cache(obj, mode)
+ end
+end
+
function m.searchRefs(status, obj, mode)
status.depth = status.depth + 1
+ local cache, makeCache = m.getCache(status, obj, mode)
+ if cache then
+ for i = 1, #cache do
+ status.results[#status.results+1] = cache[i]
+ end
+ return
+ end
+
-- 检查单步引用
local res = m.getStepRef(obj, mode)
if res then
@@ -1759,6 +1780,10 @@ function m.searchRefs(status, obj, mode)
status.depth = status.depth - 1
m.cleanResults(status.results)
+
+ if makeCache then
+ makeCache(status.results)
+ end
end
function m.searchRefOfValue(status, obj)