diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/core/noder.lua | 12 | ||||
-rw-r--r-- | script/core/searcher.lua | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua index c2f2061a..893c5cac 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -13,6 +13,7 @@ local ssub = string.sub local sformat = string.format local sgsub = string.gsub local smatch = string.match +local sfind = string.find _ENV = nil @@ -1380,6 +1381,17 @@ function m.isCommonField(field) return true end +---是否是普通的field,例如数字或字符串,而不是函数返回值等 +function m.hasCall(field) + if not field then + return false + end + if sfind(field, RETURN_INDEX, 1, true) then + return true + end + return false +end + function m.isGlobalID(id) return ssub(id, 1, 2) == 'g:' or ssub(id, 1, 3) == 'dn:' diff --git a/script/core/searcher.lua b/script/core/searcher.lua index 13e0f621..973c57a9 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -43,6 +43,7 @@ local eachSource = noder.eachSource local compileAllNodes = noder.compileAllNodes local compilePartNoders = noder.compilePartNodes local isGlobalID = noder.isGlobalID +local hasCall = noder.hasCall local SPLIT_CHAR = noder.SPLIT_CHAR local RETURN_INDEX = noder.RETURN_INDEX @@ -799,7 +800,8 @@ function m.searchRefsByID(status, suri, expect, mode) if mode == 'def' or mode == 'alldef' or ignoredIDs[id] - or id == 'dn:string' then + or id == 'dn:string' + or hasCall(field) then for _, guri in ceach('def:' .. id) do if uri == guri then goto CONTINUE |