summaryrefslogtreecommitdiff
path: root/src/scripts/elua/apps/docgen/doctree.lua
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-09 15:25:10 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-09 15:58:52 +0100
commit051f277be25017142a74befce5ed586df3967598 (patch)
tree3ec0f92f22e5f75ac2cc59ba39ac1698c3acfc66 /src/scripts/elua/apps/docgen/doctree.lua
parent3f50c73031136e52cb4af41af93d2e7aca03184a (diff)
docs: reverse inheritance hierarchy api in doctree
Diffstat (limited to '')
-rw-r--r--src/scripts/elua/apps/docgen/doctree.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/scripts/elua/apps/docgen/doctree.lua b/src/scripts/elua/apps/docgen/doctree.lua
index f8876ced3b..c388c0f3c9 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -144,6 +144,8 @@ M.Doc = Node:clone {
144 end 144 end
145} 145}
146 146
147local revh = {}
148
147M.Class = Node:clone { 149M.Class = Node:clone {
148 -- class types 150 -- class types
149 UNKNOWN = eolian.class_type.UNKNOWN, 151 UNKNOWN = eolian.class_type.UNKNOWN,
@@ -207,6 +209,10 @@ M.Class = Node:clone {
207 return self.class:inherits_get():to_array() 209 return self.class:inherits_get():to_array()
208 end, 210 end,
209 211
212 children_get = function(self)
213 return revh[self:full_name_get()]
214 end,
215
210 functions_get = function(self, ft) 216 functions_get = function(self, ft)
211 local ret = {} 217 local ret = {}
212 for fn in self.class:functions_get(ft) do 218 for fn in self.class:functions_get(ft) do
@@ -1403,6 +1409,18 @@ M.parse = function()
1403 if not eolian.all_eo_files_parse() then 1409 if not eolian.all_eo_files_parse() then
1404 error("failed parsing eo files") 1410 error("failed parsing eo files")
1405 end 1411 end
1412 -- build reverse inheritance hierarchy
1413 for cl in eolian.all_classes_get() do
1414 local cln = cl:full_name_get()
1415 for icl in cl:inherits_get() do
1416 local t = revh[icl]
1417 if not t then
1418 t = {}
1419 revh[icl] = t
1420 end
1421 t[#t + 1] = cln
1422 end
1423 end
1406end 1424end
1407 1425
1408return M 1426return M