summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/parser/luadoc.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 0e560b0d..040a9a9b 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -163,8 +163,9 @@ local function parseTokens(text, offset)
Ci = 0
end
-local function peekToken()
- return TokenTypes[Ci+1], TokenContents[Ci+1]
+local function peekToken(offset)
+ offset = offset or 1
+ return TokenTypes[Ci + offset], TokenContents[Ci + offset]
end
---@return string? tokenType
@@ -992,8 +993,12 @@ local docSwitch = util.switch()
if value == 'public'
or value == 'protected'
or value == 'private'
- or value == 'public'
or value == 'package' then
+ local tp2 = peekToken(1)
+ local tp3 = peekToken(2)
+ if tp2 == 'name' and not tp3 then
+ return false
+ end
result.visible = value
result.start = getStart()
return true