From e250b80fbc3ee9f69fd5ed78fa4f858925c182fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 7 Apr 2022 00:43:00 +0800 Subject: update --- script/vm/compiler.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'script/vm/compiler.lua') diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 7c5eb721..57816e24 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -362,7 +362,6 @@ local function getReturn(func, index, args) end local function bindDocs(source) - local hasFounded = false local isParam = source.parent.type == 'funcargs' or source.parent.type == 'in' local docs = source.bindDocs @@ -389,6 +388,20 @@ local function bindDocs(source) return true end end + if doc.type == 'doc.module' then + local name = doc.module + local uri = rpath.findUrisByRequirePath(guide.getUri(source), name)[1] + if not uri then + return nil + end + local state = files.getState(uri) + local ast = state and state.ast + if not ast then + return nil + end + nodeMgr.setNode(source, m.compileNode(ast)) + return true + end end return false end -- cgit v1.2.3