summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-24 15:47:25 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-24 15:47:25 +0100
commit3f92a51b9a6db9a320a94dd6d958ce90c7e6e345 (patch)
tree4cf9f1c37c65c7d00f037b417e3e58eafcb0d886
parent2537cd2cf796671bfcd593da3e38787f30f43ee3 (diff)
docgen: merge overridden and other categories for methods/properties
-rw-r--r--src/scripts/elua/apps/gendoc.lua34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index 508b3257e8..c45c84366a 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -698,20 +698,19 @@ find_parent_briefdoc = function(fulln, cl)
698 return pdoc:brief_get(pdocf) 698 return pdoc:brief_get(pdocf)
699end 699end
700 700
701local build_functable = function(f, title, cl, tbl) 701local build_functable = function(f, title, tcl, tbl, newm)
702 if #tbl == 0 then 702 if #tbl == 0 then
703 return 703 return
704 end 704 end
705 f:write_h(title, 2) 705 f:write_h(title, 2)
706 local nt = {} 706 local nt = {}
707 local oclass = not cl 707 for i, implt in ipairs(tbl) do
708 for i, impl in ipairs(tbl) do
709 local lbuf = writer.Buffer() 708 local lbuf = writer.Buffer()
710 709
711 if oclass then 710 local cl, impl = unpack(implt)
712 local impt = impl 711 local ocl = impl:class_get()
713 cl, impl = impt[1], impt[2] 712 if not newm then
714 lbuf:write_link(cl:nspaces_get(true), cl:full_name_get()) 713 lbuf:write_link(ocl:nspaces_get(true), ocl:full_name_get())
715 lbuf:write_raw(".") 714 lbuf:write_raw(".")
716 end 715 end
717 716
@@ -742,9 +741,13 @@ local build_functable = function(f, title, cl, tbl)
742 if over then 741 if over then
743 lbuf:write_raw(" ") 742 lbuf:write_raw(" ")
744 local llbuf = writer.Buffer() 743 local llbuf = writer.Buffer()
745 local icl = impl:class_get() 744 llbuf:write_raw("[Overridden")
746 llbuf:write_raw("[from ") 745 if cl ~= tcl then
747 llbuf:write_link(icl:nspaces_get(true), icl:full_name_get()) 746 llbuf:write_raw(" in ")
747 llbuf:write_link(cl:nspaces_get(true), cl:full_name_get())
748 else
749 llbuf:write_raw(" here")
750 end
748 llbuf:write_raw("]") 751 llbuf:write_raw("]")
749 lbuf:write_i(llbuf:finish()) 752 lbuf:write_i(llbuf:finish())
750 end 753 end
@@ -869,21 +872,20 @@ local build_class = function(cl)
869 872
870 local written = {} 873 local written = {}
871 local ievs = {} 874 local ievs = {}
872 local meths, methos, omeths = {}, {}, {} 875 local meths, omeths = {}, {}
873 for i, impl in ipairs(cl:implements_get()) do 876 for i, impl in ipairs(cl:implements_get()) do
874 local func = impl:function_get() 877 local func = impl:function_get()
875 written[func:id_get()] = true 878 written[func:id_get()] = true
876 if impl:is_overridden(cl) then 879 if impl:is_overridden(cl) then
877 methos[#methos + 1] = impl 880 omeths[#omeths + 1] = { cl, impl }
878 else 881 else
879 meths[#meths + 1] = impl 882 meths[#meths + 1] = { cl, impl }
880 end 883 end
881 end 884 end
882 find_callables(cl, omeths, ievs, written) 885 find_callables(cl, omeths, ievs, written)
883 886
884 build_functable(f, "Members", cl, meths) 887 build_functable(f, "Members", cl, meths, true)
885 build_functable(f, "Overrides", cl, methos) 888 build_functable(f, "Inherited", cl, omeths, false)
886 build_functable(f, "Others", nil, omeths)
887 889
888 build_evtable(f, "Events", cl, cl:events_get()) 890 build_evtable(f, "Events", cl, cl:events_get())
889 build_evtable(f, "Inherited Events", nil, ievs) 891 build_evtable(f, "Inherited Events", nil, ievs)