From 1face5ab84618c03ad3077252ae289774ce7a816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 7 Mar 2022 16:47:10 +0800 Subject: fix #975 --- script/parser/luadoc.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'script/parser') diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index a47ebe34..d15fd95a 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -668,20 +668,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 -- cgit v1.2.3