summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-09 16:04:59 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-09 16:04:59 +0100
commit9540e96107f7f6f759c3a7ed51d90a8883fc2310 (patch)
tree19899593bbc848c5bb73b164c4489c9f04a7ff71 /src
parent5e50c9d52bf65427b48ab572930a1583d3482ddf (diff)
docs: avoid possible duplicates when figuring out all impls of a func
Diffstat (limited to 'src')
-rw-r--r--src/scripts/elua/apps/gendoc.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index 524583acaf..9cbbf7a139 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -1018,7 +1018,12 @@ end
1018local impls_of = {} 1018local impls_of = {}
1019 1019
1020local get_all_impls_of 1020local get_all_impls_of
1021get_all_impls_of = function(tbl, cl, fn) 1021get_all_impls_of = function(tbl, cl, fn, got)
1022 local cfn = cl:full_name_get()
1023 if got[cfn] then
1024 return
1025 end
1026 got[cfn] = true
1022 for i, imp in ipairs(cl:implements_get()) do 1027 for i, imp in ipairs(cl:implements_get()) do
1023 local ofn = imp:function_get() 1028 local ofn = imp:function_get()
1024 if ofn:is_same(fn) then 1029 if ofn:is_same(fn) then
@@ -1028,7 +1033,7 @@ get_all_impls_of = function(tbl, cl, fn)
1028 end 1033 end
1029 for i, cln in ipairs(cl:children_get()) do 1034 for i, cln in ipairs(cl:children_get()) do
1030 local icl = dtree.Class.by_name_get(cln) 1035 local icl = dtree.Class.by_name_get(cln)
1031 get_all_impls_of(tbl, icl, fn) 1036 get_all_impls_of(tbl, icl, fn, got)
1032 end 1037 end
1033end 1038end
1034 1039
@@ -1041,7 +1046,7 @@ local write_ilist = function(f, impl, cl)
1041 if not imps then 1046 if not imps then
1042 imps = {} 1047 imps = {}
1043 impls_of[onm] = imps 1048 impls_of[onm] = imps
1044 get_all_impls_of(imps, ocl, fn) 1049 get_all_impls_of(imps, ocl, fn, {})
1045 end 1050 end
1046 1051
1047 f:write_h("Implemented by", 2) 1052 f:write_h("Implemented by", 2)