diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-09-29 20:50:09 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-09-29 20:50:09 +0800 |
commit | 3a3041e820b5c6aa9088e642387ae5f7b99f2a64 (patch) | |
tree | bb0293ee37e395b50bc04919fa0d1877d71c6ff2 /script/parser/luadoc.lua | |
parent | 170f587b41b01911f49250b0acc011d00c4e4008 (diff) | |
download | lua-language-server-3a3041e820b5c6aa9088e642387ae5f7b99f2a64.zip |
#632
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r-- | script/parser/luadoc.lua | 24 |
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 |