summaryrefslogtreecommitdiff
path: root/script/vm/doc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/doc.lua')
-rw-r--r--script/vm/doc.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/script/vm/doc.lua b/script/vm/doc.lua
index 5cb039fe..6ac39910 100644
--- a/script/vm/doc.lua
+++ b/script/vm/doc.lua
@@ -471,3 +471,18 @@ function vm.getCastTargetHead(doc)
end
return nil
end
+
+---@param doc parser.object
+---@param key string
+---@return boolean
+function vm.docHasAttr(doc, key)
+ if not doc.docAttr then
+ return false
+ end
+ for _, name in ipairs(doc.docAttr.names) do
+ if name[1] == key then
+ return true
+ end
+ end
+ return false
+end