diff options
Diffstat (limited to 'script/vm/global.lua')
-rw-r--r-- | script/vm/global.lua | 44 |
1 files changed, 23 insertions, 21 deletions
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 |