From c41bb4d07d8ad4645ff26c54bb175233c8daea5d 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, 25 May 2021 20:43:36 +0800 Subject: update --- script/parser/luadoc.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'script/parser/luadoc.lua') diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 2d21c9ac..054ea3f1 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -194,6 +194,7 @@ local function parseClass(parent) local result = { type = 'doc.class', parent = parent, + fields = {}, } result.class = parseName('doc.class.name', result) if not result.class then @@ -1170,6 +1171,18 @@ local function bindParamAndReturnIndex(binded) end end +local function bindClassAndFields(binded) + local class + for _, doc in ipairs(binded) do + if doc.type == 'doc.class' then + class = doc + elseif doc.type == 'doc.field' then + class.fields[#class.fields+1] = doc + doc.class = class + end + end +end + local function bindDoc(sources, lns, binded) if not binded then return @@ -1192,6 +1205,7 @@ local function bindDoc(sources, lns, binded) bindDocsBetween(sources, binded, bindSources, nstart, nfinish) end bindParamAndReturnIndex(binded) + bindClassAndFields(binded) end local function bindDocs(state) -- cgit v1.2.3