diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/core/noder.lua | 5 | ||||
-rw-r--r-- | script/core/searcher.lua | 18 |
2 files changed, 11 insertions, 12 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua index 7a1733de..8fd7603c 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -109,7 +109,7 @@ local function getKey(source) elseif source.type == 'function' then return source.start, nil elseif source.type == 'string' then - return '', nil + return source.start, nil elseif source.type == 'integer' or source.type == 'number' or source.type == 'boolean' @@ -532,6 +532,9 @@ function m.compileNode(noders, source) local node = getNode(noders, id) node.skip = true end + if source.type == 'string' then + pushForward(noders, id, 'str:') + end -- self -> mt:xx if source.type == 'local' and source[1] == 'self' then local func = guide.getParentFunction(source) diff --git a/script/core/searcher.lua b/script/core/searcher.lua index 79e80577..839417fd 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -445,16 +445,14 @@ function m.searchRefsByID(status, uri, expect, mode) end end - local function checkSpecial(id, node, field) + local function checkSpecial(id, field) -- Special rule: ('').XX -> stringlib.XX if id == 'str:' or id == 'dn:string' then if field or mode == 'field' then searchID('dn:stringlib', field) end - return true end - return false end local function checkRequire(requireName, field) @@ -556,14 +554,11 @@ function m.searchRefsByID(status, uri, expect, mode) checkRequire(node.require, field) end - local isSepcial = checkSpecial(id, node, field) - if not isSepcial then - if node.forward then - checkForward(id, node, field) - end - if node.backward then - checkBackward(id, node, field) - end + if node.forward then + checkForward(id, node, field) + end + if node.backward then + checkBackward(id, node, field) end if node.sources then @@ -631,6 +626,7 @@ function m.searchRefsByID(status, uri, expect, mode) return end end + checkSpecial(id, field) local node = noder.getNodeByID(root, id) if node then searchNode(id, node, field) |