summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-23 16:30:57 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-23 17:09:32 +0100
commit8e65011a4b11451b7fc2f5672ff5c804929cba3b (patch)
tree8d45573fe43e29d9a79db05dc9af174338986e70
parentbc31a47fd9b8138b09c45ade703ab0f3736a54dd (diff)
docgen: properly handle overridden property docs
-rw-r--r--src/scripts/elua/apps/gendoc.lua36
1 files changed, 26 insertions, 10 deletions
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index 4dbd433bed..cb7c1dfc4f 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -1060,7 +1060,7 @@ find_parent_doc = function(fulln, cl, ftype)
1060 return pdoc 1060 return pdoc
1061end 1061end
1062 1062
1063local write_inherited_from = function(f, impl, cl, over) 1063local write_inherited_from = function(f, impl, cl, over, prop)
1064 if not over then 1064 if not over then
1065 return 1065 return
1066 end 1066 end
@@ -1070,6 +1070,22 @@ local write_inherited_from = function(f, impl, cl, over)
1070 buf:write_link( 1070 buf:write_link(
1071 impl:function_get():nspaces_get(pcl, true), impl:full_name_get() 1071 impl:function_get():nspaces_get(pcl, true), impl:full_name_get()
1072 ) 1072 )
1073 if prop then
1074 buf:write_raw(" ")
1075 local lbuf = writer.Buffer()
1076 lbuf:write_raw("(")
1077 if impl:is_prop_get() then
1078 lbuf:write_raw("get")
1079 if impl:is_prop_set() then
1080 lbuf:write_raw(", ")
1081 end
1082 end
1083 if impl:is_prop_set() then
1084 lbuf:write_raw("set")
1085 end
1086 lbuf:write_raw(")")
1087 buf:write_b(lbuf:finish())
1088 end
1073 buf:write_raw(".") 1089 buf:write_raw(".")
1074 f:write_i(buf:finish()) 1090 f:write_i(buf:finish())
1075end 1091end
@@ -1132,7 +1148,7 @@ build_method = function(impl, cl)
1132 printgen("Generating method: " .. methn) 1148 printgen("Generating method: " .. methn)
1133 stats.check_method(fn, cl) 1149 stats.check_method(fn, cl)
1134 1150
1135 write_inherited_from(f, impl, cl, over) 1151 write_inherited_from(f, impl, cl, over, false)
1136 1152
1137 local doc = impl:doc_get(fn.METHOD) 1153 local doc = impl:doc_get(fn.METHOD)
1138 if over and not doc:exists() then 1154 if over and not doc:exists() then
@@ -1175,19 +1191,19 @@ build_property = function(impl, cl)
1175 local f = writer.Writer(pns, propn) 1191 local f = writer.Writer(pns, propn)
1176 printgen("Generating property: " .. propn) 1192 printgen("Generating property: " .. propn)
1177 1193
1178 write_inherited_from(f, impl, cl, over) 1194 write_inherited_from(f, impl, cl, over, true)
1179 1195
1180 local isget = impl:is_prop_get() 1196 local pimp = fn:implement_get()
1181 local isset = impl:is_prop_set() 1197
1198 local isget = pimp:is_prop_get()
1199 local isset = pimp:is_prop_set()
1182 1200
1183 if isget then stats.check_property(fn, cl, fn.PROP_GET) end 1201 if isget then stats.check_property(fn, cl, fn.PROP_GET) end
1184 if isset then stats.check_property(fn, cl, fn.PROP_SET) end 1202 if isset then stats.check_property(fn, cl, fn.PROP_SET) end
1185 1203
1186 local pimp = fn:implement_get() 1204 local doc = impl:doc_get(fn.PROPERTY)
1187 1205 local gdoc = impl:doc_get(fn.PROP_GET)
1188 local doc = pimp:doc_get(fn.PROPERTY) 1206 local sdoc = impl:doc_get(fn.PROP_SET)
1189 local gdoc = pimp:doc_get(fn.PROP_GET)
1190 local sdoc = pimp:doc_get(fn.PROP_SET)
1191 1207
1192 if over then 1208 if over then
1193 if not doc:exists() then 1209 if not doc:exists() then