q66 pushed a commit to branch master. http://git.enlightenment.org/tools/edocgen.git/commit/?id=e4583ad539d9c7b327889b8519638581293d870c
commit e4583ad539d9c7b327889b8519638581293d870c Author: Daniel Kolesa <d.kol...@samsung.com> Date: Mon Dec 17 16:31:54 2018 +0100 update after eolian api changes --- docgen/eolian_utils.lua | 96 +++++++++++++++++++++++++++++++------------------ gendoc.lua | 22 +++++++++--- 2 files changed, 79 insertions(+), 39 deletions(-) diff --git a/docgen/eolian_utils.lua b/docgen/eolian_utils.lua index 11a6e5b..5680b86 100644 --- a/docgen/eolian_utils.lua +++ b/docgen/eolian_utils.lua @@ -707,16 +707,24 @@ M.class_children_get = function(cl) return revh[cl:name_get()] or {} end +local build_child = function(icl, cl) + local icln = icl:name_get() + local t = revh[icln] + if not t then + t = {} + revh[icln] = t + end + t[#t + 1] = cl +end + M.build_class_children = function(eos) for cl in eos:classes_get() do - for icl in cl:inherits_get() do - local icln = icl:name_get() - local t = revh[icln] - if not t then - t = {} - revh[icln] = t - end - t[#t + 1] = cl + local pcl = cl:parent_get() + if pcl then + build_child(pcl, cl) + end + for icl in cl:extensions_get() do + build_child(icl, cl) end end end @@ -724,24 +732,33 @@ end -- finds all stuff that is callable on a class, respecting -- overrides and not duplicating, does a depth-first search local find_callables -find_callables = function(cl, omeths, events, written) - for pcl in cl:inherits_get() do - for impl in pcl:implements_get() do - local func = impl:function_get() - local fid = M.obj_id_get(func) - if not written[fid] then - omeths[#omeths + 1] = { pcl, impl } - written[fid] = true - end + +local callable_cb = function(pcl, omeths, events, written) + for impl in pcl:implements_get() do + local func = impl:function_get() + local fid = M.obj_id_get(func) + if not written[fid] then + omeths[#omeths + 1] = { pcl, impl } + written[fid] = true end - for ev in pcl:events_get() do - local evid = ev:name_get() - if not written[evid] then - events[#events + 1] = { pcl, ev } - written[evid] = true - end + end + for ev in pcl:events_get() do + local evid = ev:name_get() + if not written[evid] then + events[#events + 1] = { pcl, ev } + written[evid] = true end - find_callables(pcl, omeths, events, written) + end + find_callables(pcl, omeths, events, written) +end + +find_callables = function(cl, omeths, events, written) + local pcl = cl:parent_get() + if pcl then + callable_cb(pcl, omeths, events, written) + end + for pcl in cl:extensions_get() do + callable_cb(pcl, omeths, events, written) end end @@ -813,18 +830,29 @@ M.sorted_funclist_get = function(tcl, tbl) end local find_parent_impl -find_parent_impl = function(fulln, cl) - for pcl in cl:inherits_get() do - for impl in pcl:implements_get() do - if impl:name_get() == fulln then - return impl, pcl - end - end - local pimpl, pcl = find_parent_impl(fulln, pcl) - if pimpl then - return pimpl, pcl + +local parent_impl_cb = function(pcl, fulln) + for impl in pcl:implements_get() do + if impl:name_get() == fulln then + return impl, pcl end end + local pimpl, pcl = find_parent_impl(fulln, pcl) + if pimpl then + return pimpl, pcl + end +end + +find_parent_impl = function(fulln, cl) + local pcl = cl:parent_get() + if pcl then + local rimp, rcl = parent_impl_cb(pcl, fulln) + if rimp then return rimp, rcl end + end + for pcl in cl:extensions_get() do + local rimp, rcl = parent_impl_cb(pcl, fulln) + if rimp then return rimp, rcl end + end return nil, cl end diff --git a/gendoc.lua b/gendoc.lua index b748f01..b6cea56 100644 --- a/gendoc.lua +++ b/gendoc.lua @@ -99,7 +99,11 @@ build_inherits = function(cl, t, lvl) t[#t + 1] = { lvl - 1, lbuf:finish() } end - for acl in cl:inherits_get() do + local pcl = cl:parent_get() + if pcl then + build_inherits(pcl, t, lvl + 1) + end + for acl in cl:extensions_get() do build_inherits(acl, t, lvl + 1) end return t @@ -114,7 +118,11 @@ build_inherit_summary = function(cl, buf) buf:write_raw(" ") buf:write_i("(" .. eoutils.class_type_str_get(cl) .. ")") - local inherits = cl:inherits_get():to_array() + local inherits = cl:extensions_get():to_array() + local pcl = cl:parent_get() + if pcl then + table.insert(inherits, 1, pcl) + end if #inherits ~= 0 then build_inherit_summary(inherits[1], buf) end @@ -412,7 +420,7 @@ local build_class = function(cl) local f = writer.Writer(cln, fulln) printgen("Generating class: " .. fulln) - mono.build_class(cl) + --mono.build_class(cl) f:write_h(cl:name_get() .. " (" .. eoutils.class_type_str_get(cl) .. ")", 1) @@ -423,7 +431,11 @@ local build_class = function(cl) f:write_editable(cln, "description") f:write_nl() - local inherits = cl:inherits_get():to_array() + local inherits = cl:extensions_get():to_array() + local pcl = cl:parent_get() + if pcl then + table.insert(inherits, 1, pcl) + end if #inherits ~= 0 then f:write_h("Inheritance", 2) @@ -850,7 +862,7 @@ getopt.parse { parse(st) eoutils.build_class_children(eos) - mono.init(eos) + --mono.init(eos) if st == "clist" then for cl in eos:classes_get() do --