diff options
-rw-r--r-- | script/parser/luadoc.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 53f0097d..80c8a732 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -842,6 +842,19 @@ local function convertTokens() end end +local function trimTailComment(text) + if text:sub(1, 1) == '@' then + return text:sub(2) + end + if text:sub(1, 1) == '#' then + return text:sub(2) + end + if text:sub(1, 2) == '--' then + return text:sub(3) + end + return text +end + local function buildLuaDoc(comment) local text = comment.text if text:sub(1, 1) ~= '-' then @@ -868,7 +881,7 @@ local function buildLuaDoc(comment) type = 'doc.tailcomment', start = cstart + comment.start - 1, finish = comment.finish, - text = text:sub(cstart), + text = trimTailComment(text:sub(cstart)), } end end |