From b353856c94faa6ec76944f5dea70af3d31a77d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 12 Oct 2022 20:35:30 +0800 Subject: search fields by chain exp resolve #1222 --- script/vm/field.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'script') diff --git a/script/vm/field.lua b/script/vm/field.lua index b92c3a7b..db53509b 100644 --- a/script/vm/field.lua +++ b/script/vm/field.lua @@ -24,11 +24,19 @@ local function searchByLocalID(source, pushResult) end end -local function searchByNode(source, pushResult) +local function searchByNode(source, pushResult, mark) + mark = mark or {} + if mark[source] then + return + end + mark[source] = true local uri = guide.getUri(source) vm.compileByParentNode(source, nil, true, function (field) searchByNodeSwitch(field.type, uri, field, pushResult) end) + vm.compileByNodeChain(source, function (src) + searchByNode(src, pushResult, mark) + end) end ---@param source parser.object -- cgit v1.2.3