summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/vm/visible.lua21
1 files changed, 18 insertions, 3 deletions
diff --git a/script/vm/visible.lua b/script/vm/visible.lua
index e550280f..d4c1c710 100644
--- a/script/vm/visible.lua
+++ b/script/vm/visible.lua
@@ -7,9 +7,7 @@ local glob = require 'glob'
---@class parser.object
---@field package _visibleType? parser.visibleType
----@param source parser.object
----@return parser.visibleType
-function vm.getVisibleType(source)
+local function getVisibleType(source)
if source._visibleType then
return source._visibleType
end
@@ -56,6 +54,23 @@ function vm.getVisibleType(source)
end
---@param source parser.object
+---@return parser.visibleType
+function vm.getVisibleType(source)
+ if source._visibleType then
+ return source._visibleType
+ end
+ for _, def in ipairs(vm.getDefs(source)) do
+ local visible = getVisibleType(def)
+ if visible ~= 'public' then
+ source._visibleType = visible
+ return visible
+ end
+ end
+ source._visibleType = 'public'
+ return 'public'
+end
+
+---@param source parser.object
---@return vm.global?
function vm.getParentClass(source)
if source.type == 'doc.field' then