docgen: properly get the secondary function type for properties

This commit is contained in:
Daniel Kolesa 2016-03-31 15:53:57 +01:00
parent 90ab6e07f1
commit 90f2f0bb65
1 changed files with 26 additions and 0 deletions

View File

@ -162,6 +162,17 @@ local Buffer = Writer:clone {
-- eolian to various doc elements conversions
local get_fallback_ftype = function(f, ftype)
if not ftype then
local ft = f:get_type()
local ftt = eolian.function_type
if ft == ftt.PROP_GET or ft == ftt.PROP_SET then
return ftt
end
end
return ftype
end
local get_brief_doc = function(doc1, doc2)
if not doc1 and not doc2 then
return "No description supplied."
@ -172,6 +183,11 @@ local get_brief_doc = function(doc1, doc2)
return doc1:summary_get()
end
local get_brief_fdoc = function(f, ftype)
return get_brief_doc(f:documentation_get(eolian.function_type.METHOD),
f:documentation_get(get_fallback_ftype(ftype)))
end
local get_full_doc = function(doc1, doc2)
if not doc1 and not doc2 then
return "No description supplied."
@ -197,6 +213,11 @@ local get_full_doc = function(doc1, doc2)
return sum1 .. "\n\n" .. desc1 .. edoc
end
local get_full_fdoc = function(f, ftype)
return get_full_doc(f:documentation_get(eolian.function_type.METHOD),
f:documentation_get(get_fallback_ftype(ftype)))
end
local gen_namespaces = function(v, subnspace, root)
local nspaces = v:namespaces_get():to_array()
for i = 1, #nspaces do
@ -333,6 +354,11 @@ local write_full_doc = function(f, doc1, doc2)
end
end
local write_full_fdoc = function(f, fn, ftype)
write_full_doc(f, fn:documentation_get(eolian.function_type.METHOD),
fn:documentation_get(get_fallback_ftype(ftype)))
end
local build_inherits
build_inherits = function(cl, t, lvl)
t = t or {}