summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/files.lua1
-rw-r--r--script/parser/guide.lua2
-rw-r--r--script/vm/getDocs.lua3
3 files changed, 5 insertions, 1 deletions
diff --git a/script/files.lua b/script/files.lua
index 71981a83..eb9fe97c 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -210,6 +210,7 @@ function m.removeAllClosed()
end
--- 遍历文件
+--- TODO: 协程不安全
function m.eachFile()
return pairs(m.fileMap)
end
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index ba858eaf..1f1ab48a 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -2263,7 +2263,7 @@ function m.pushResult(status, mode, ref, simple)
end
end
if m.isLiteral(ref)
- and ref.parent.type == 'callargs'
+ and ref.parent and ref.parent.type == 'callargs'
and ref ~= simple.node then
results[#results+1] = ref
end
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index 1c54d593..632dd1c2 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -51,6 +51,9 @@ local function getDocTypes(name)
end
function vm.getDocEnums(doc, mark, results)
+ if not doc then
+ return nil
+ end
mark = mark or {}
if mark[doc] then
return nil