summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-10-25 03:11:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-10-25 03:11:49 +0800
commit28dc2d3adce8729c90cf8abdaf5eb46efd39f2f1 (patch)
tree46bf83aa9f001f006e3ee42872838bea5a9a0660 /script/parser
parent8f2dac8ba32271e45061128070063e0ddd0d73c4 (diff)
downloadlua-language-server-28dc2d3adce8729c90cf8abdaf5eb46efd39f2f1.zip
`---@private` and `---@protected`
#1316
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/luadoc.lua22
1 files changed, 20 insertions, 2 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 71579fc4..bd631318 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -149,7 +149,7 @@ Symbol <- ({} {
---@field names? parser.object[]
---@field path? string
---@field bindComments? parser.object[]
----@field visible? 'public' | 'protected' | 'private'
+---@field visible? parser.visibleType
local function parseTokens(text, offset)
Ci = 0
@@ -1445,6 +1445,22 @@ local docSwitch = util.switch()
name.parent = result
return result
end)
+ : case 'private'
+ : call(function ()
+ return {
+ type = 'doc.private',
+ start = getFinish(),
+ finish = getFinish(),
+ }
+ end)
+ : case 'protected'
+ : call(function ()
+ return {
+ type = 'doc.protected',
+ start = getFinish(),
+ finish = getFinish(),
+ }
+ end)
local function convertTokens(doc)
local tp, text = nextToken()
@@ -1660,7 +1676,9 @@ local function bindDoc(source, binded)
or doc.type == 'doc.deprecated'
or doc.type == 'doc.version'
or doc.type == 'doc.module'
- or doc.type == 'doc.source' then
+ or doc.type == 'doc.source'
+ or doc.type == 'doc.private'
+ or doc.type == 'doc.protected' then
if source.type == 'function'
or isParam then
goto CONTINUE