From d5327b0fc28e638ff79845846981358938deb9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 27 Jun 2022 21:00:38 +0800 Subject: improve --- script/vm/compiler.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index d39c9c61..c249b44d 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1893,11 +1893,14 @@ local function compileByGlobal(source) globalNode:merge(vm.compileNode(set)) hasMarkDoc = true end + if vm.getNode(set) then + globalNode:merge(vm.compileNode(set)) + end end end -- Set all globals node first to avoid recursive for _, set in ipairs(global:getSets(uri)) do - vm.setNode(set, globalNode) + vm.setNode(set, globalNode, true) end for _, set in ipairs(global:getSets(uri)) do if set.value then @@ -1905,7 +1908,9 @@ local function compileByGlobal(source) globalNode:merge(vm.compileNode(set.value)) end end - vm.setNode(set, globalNode) + end + for _, set in ipairs(global:getSets(uri)) do + vm.setNode(set, globalNode, true) end end if global.cate == 'type' then -- cgit v1.2.3