summaryrefslogtreecommitdiff
path: root/script/parser/luadoc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-29 20:50:09 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-29 20:50:09 +0800
commit3a3041e820b5c6aa9088e642387ae5f7b99f2a64 (patch)
treebb0293ee37e395b50bc04919fa0d1877d71c6ff2 /script/parser/luadoc.lua
parent170f587b41b01911f49250b0acc011d00c4e4008 (diff)
downloadlua-language-server-3a3041e820b5c6aa9088e642387ae5f7b99f2a64.zip
#632
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r--script/parser/luadoc.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 37447328..f6de87fd 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -1065,6 +1065,28 @@ local function parseDiagnostic()
return result
end
+local function parseModule()
+ local result = {
+ type = 'doc.module',
+ start = getFinish(),
+ finish = getFinish(),
+ }
+ local tp, content = peekToken()
+ if tp == 'string' then
+ result.module = content
+ nextToken()
+ result.start = getStart()
+ result.finish = getFinish()
+ else
+ pushError {
+ type = 'LUADOC_MISS_MODULE_NAME',
+ start = getFinish(),
+ finish = getFinish(),
+ }
+ end
+ return result
+end
+
local function convertTokens()
local tp, text = nextToken()
if not tp then
@@ -1106,6 +1128,8 @@ local function convertTokens()
return parseSee()
elseif text == 'diagnostic' then
return parseDiagnostic()
+ elseif text == 'module' then
+ return parseModule()
end
end