summaryrefslogtreecommitdiff
path: root/script/parser/luadoc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-22 00:36:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-22 00:36:32 +0800
commitd16545d285de2451b3d2c0a03cc299ef18ac0ca0 (patch)
treef2c10898ea928d651c6c563f88ac1e77c02c00d9 /script/parser/luadoc.lua
parent629e8e052e444c51fb00e9d3af5a8c2a5ee371f8 (diff)
downloadlua-language-server-d16545d285de2451b3d2c0a03cc299ef18ac0ca0.zip
add `--[[@as type]]`
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r--script/parser/luadoc.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index a5b84fe1..f44b789b 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -125,6 +125,8 @@ Symbol <- ({} {
---@class parser.object
---@field literal boolean
---@field signs parser.object[]
+---@field originalComment parser.object
+---@field as parser.object
local function trim(str)
return str:match '^%s*(%S+)%s*$'
@@ -1192,7 +1194,17 @@ local docSwitch = util.switch()
finish = getFinish(),
}
end)
-
+ : case 'as'
+ : call(function ()
+ local result = {
+ type = 'doc.as',
+ start = getFinish(),
+ finish = getFinish(),
+ }
+ result.as = parseType(result)
+ result.finish = getFinish()
+ return result
+ end)
local function convertTokens()
local tp, text = nextToken()