summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-03 17:29:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-03 17:29:18 +0800
commit7b76328600dd9bc5206f38a549da9e4f99c9ff84 (patch)
tree979dccdcb4c29a2f8e57f0730c0ff58b827b1af8 /script/parser
parented6011c30754bfaa646f5a9a819f20f1f32cbfba (diff)
downloadlua-language-server-7b76328600dd9bc5206f38a549da9e4f99c9ff84.zip
#687 `---@nodiscard`
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/luadoc.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 6f7593c1..c332d4c0 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -1119,6 +1119,14 @@ local function parseAsync()
}
end
+local function parseNoDiscard()
+ return {
+ type = 'doc.nodiscard',
+ start = getFinish(),
+ finish = getFinish(),
+ }
+end
+
local function convertTokens()
local tp, text = nextToken()
if not tp then
@@ -1164,6 +1172,8 @@ local function convertTokens()
return parseModule()
elseif text == 'async' then
return parseAsync()
+ elseif text == 'nodiscard' then
+ return parseNoDiscard()
end
end