summaryrefslogtreecommitdiff
path: root/script/parser/luadoc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-25 22:41:52 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-25 22:41:52 +0800
commitc5ac7aa810c1f39c3c09de02b7d43be88e87b1f4 (patch)
treeb4244b0f1c4b10a985c241d0d67b08db94f4b739 /script/parser/luadoc.lua
parent1e3c7a0c12d215fc5c61dff6e8f2091a678962ff (diff)
parentf6b9b0e94764b7f950a4a0e7c41df12a75448edf (diff)
downloadlua-language-server-c5ac7aa810c1f39c3c09de02b7d43be88e87b1f4.zip
Merge commit 'f6b9b0e94764b7f950a4a0e7c41df12a75448edf' into 3.0
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r--script/parser/luadoc.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index ebbc8bcb..cf734a53 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -714,20 +714,21 @@ function parseType(parent)
if currentRow < nextCommRow then
return false
end
- if nextComm.text:sub(1, 2) == '-@' then
+ if nextComm.text:match '^%-%s*%@' then
return false
else
- if nextComm.text:sub(1, 2) == '-|' then
+ local resumeHead = nextComm.text:match '^%-%s*%|'
+ if resumeHead then
NextComment(i)
row = row + i + 1
- local finishPos = nextComm.text:find('#', 3) or #nextComm.text
- parseTokens(nextComm.text:sub(3, finishPos), nextComm.start + 3)
+ local finishPos = nextComm.text:find('#', #resumeHead + 1) or #nextComm.text
+ parseTokens(nextComm.text:sub(#resumeHead + 1, finishPos), nextComm.start + #resumeHead + 1)
local resume = parseResume(result)
if resume then
if comments then
resume.comment = table.concat(comments, '\n')
else
- resume.comment = nextComm.text:match('#%s*(.+)', 3)
+ resume.comment = nextComm.text:match('#%s*(.+)', #resumeHead + 1)
end
result.types[#result.types+1] = resume
result.finish = resume.finish