From de6582c44f4ca5e3bd10e2a3a5f875ee61f64569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 14 Aug 2020 18:15:27 +0800 Subject: =?UTF-8?q?=E7=AE=80=E5=8D=95=E8=AE=A1=E7=AE=97=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E5=A4=8D=E6=9D=82=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/parser/guide.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'script-beta') diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua index 8d7c3d9c..d295bf8b 100644 --- a/script-beta/parser/guide.lua +++ b/script-beta/parser/guide.lua @@ -904,7 +904,9 @@ m.Version = 53 function m.status(parentStatus, interface) local status = { - cache = parentStatus and parentStatus.cache or {}, + cache = parentStatus and parentStatus.cache or { + count = 0, + }, depth = parentStatus and parentStatus.depth or 0, interface = parentStatus and parentStatus.interface or {}, lock = parentStatus and parentStatus.lock or {}, @@ -1583,6 +1585,7 @@ function m.searchSameFields(status, simple, mode) if not mark[data.obj] then status.lock[data.obj] = true mark[data.obj] = true + status.cache.count = status.cache.count + 1 m.checkSameSimple(status, simple, data, mode, status.results, queue) status.lock[data.obj] = nil end @@ -1752,7 +1755,11 @@ function m.requestReference(obj, interface) m.searchRefsAsFunction(status, obj, 'ref') - return status.results + if m.debugMode then + print('count:', status.cache.count) + end + + return status.results, status.cache.count end --- 请求对象的定义,包括 `a.b.c` 形式 @@ -1763,7 +1770,7 @@ function m.requestDefinition(obj, interface) -- 根据 field 搜索定义 m.searchRefs(status, obj, 'def') - return status.results + return status.results, status.cache.count end --- 请求对象的域 -- cgit v1.2.3