From a3b5dcb6403bbcdd87e021f83e79c46796f68ce8 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, 13 Jan 2023 16:28:54 +0800 Subject: fix --- script/vm/global.lua | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'script/vm/global.lua') diff --git a/script/vm/global.lua b/script/vm/global.lua index 0a90829a..19474bb5 100644 --- a/script/vm/global.lua +++ b/script/vm/global.lua @@ -546,31 +546,33 @@ function vm.compileByGlobal(source) if not global then return false end - if global.cate == 'type' then - vm.setNode(source, global) - return false - end vm.setNode(source, global) - if guide.isAssign(source) then - if vm.bindDocs(source) then - return true - end - if source.value then - vm.setNode(source, vm.compileNode(source.value)) + if global.cate == 'variable' then + if guide.isAssign(source) then + if vm.bindDocs(source) then + return true + end + if source.value then + vm.setNode(source, vm.compileNode(source.value)) + return true + end + else + if vm.bindAs(source) then + return true + end + local node = vm.traceNode(source) + if node then + vm.setNode(source, node, true) + return true + end end - return true end - local node = vm.traceNode(source) - if node then - vm.setNode(source, node, true) - else - local globalBase = vm.getGlobalBase(source) - if not globalBase then - return false - end - local globalNode = vm.compileNode(globalBase) - vm.setNode(source, globalNode, true) + local globalBase = vm.getGlobalBase(source) + if not globalBase then + return false end + local globalNode = vm.compileNode(globalBase) + vm.setNode(source, globalNode, true) return true end -- cgit v1.2.3