summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua15
1 files changed, 14 insertions, 1 deletions
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