From 135f38d1b4f4d7b989f738bead5b59bdaf58f7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 20 Oct 2020 16:58:57 +0800 Subject: =?UTF-8?q?luadoc=E7=9A=84=E7=AC=AC=E4=B8=80=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/parser/luadoc.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'script-beta/parser/luadoc.lua') diff --git a/script-beta/parser/luadoc.lua b/script-beta/parser/luadoc.lua index ebab1ee9..c84cf52b 100644 --- a/script-beta/parser/luadoc.lua +++ b/script-beta/parser/luadoc.lua @@ -671,7 +671,10 @@ return function (_, state) table.sort(comments, function (a, b) return a.start < b.start end) - ast.docs = {} + ast.docs = { + type = 'doc', + parent = ast, + } pushError = state.pushError @@ -679,6 +682,13 @@ return function (_, state) local doc = buildLuaDoc(comment) if doc then ast.docs[#ast.docs+1] = doc + doc.parent = ast.docs + if ast.start > doc.start then + ast.start = doc.start + end + if ast.finish < doc.finish then + ast.finish = doc.finish + end end end end -- cgit v1.2.3