forked from enlightenment/efl
docs: integrate fallback func doc into Function
This commit is contained in:
parent
aa5068d1e2
commit
c32a8ff125
|
@ -292,6 +292,19 @@ M.Function = Node:clone {
|
||||||
return M.Doc(self.func:documentation_get(ft))
|
return M.Doc(self.func:documentation_get(ft))
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
fallback_doc_get = function(self, ft)
|
||||||
|
if not ft then
|
||||||
|
local fft = self:type_get()
|
||||||
|
if fft == self.PROP_GET or fft == self.PROP_SET then
|
||||||
|
ft = fft
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if ft then
|
||||||
|
return self:doc_get(ft)
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end,
|
||||||
|
|
||||||
is_virtual_pure = function(self, ft)
|
is_virtual_pure = function(self, ft)
|
||||||
return self.func:is_virtual_pure(ft)
|
return self.func:is_virtual_pure(ft)
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -13,25 +13,12 @@ local dtree = require("docgen.doctree")
|
||||||
|
|
||||||
-- eolian to various doc elements conversions
|
-- eolian to various doc elements conversions
|
||||||
|
|
||||||
local get_fallback_fdoc = function(f, ftype)
|
|
||||||
if not ftype then
|
|
||||||
local ft = f:type_get()
|
|
||||||
if ft == f.PROP_GET or ft == f.PROP_SET then
|
|
||||||
ftype = ft
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if ftype then
|
|
||||||
return f:doc_get(ftype)
|
|
||||||
end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local get_brief_fdoc = function(f, ftype)
|
local get_brief_fdoc = function(f, ftype)
|
||||||
return f:doc_get(f.METHOD):brief_get(get_fallback_fdoc(f, ftype))
|
return f:doc_get(f.METHOD):brief_get(f:fallback_doc_get(ftype))
|
||||||
end
|
end
|
||||||
|
|
||||||
local get_full_fdoc = function(f, ftype)
|
local get_full_fdoc = function(f, ftype)
|
||||||
return f:doc_get(f.METHOD):full_get(get_fallback_fdoc(f, ftype))
|
return f:doc_get(f.METHOD):full_get(f:fallback_doc_get(ftype))
|
||||||
end
|
end
|
||||||
|
|
||||||
local propt_to_type = {
|
local propt_to_type = {
|
||||||
|
@ -423,7 +410,7 @@ end
|
||||||
|
|
||||||
local write_full_fdoc = function(f, fn, ftype)
|
local write_full_fdoc = function(f, fn, ftype)
|
||||||
f:write_raw(fn:doc_get(fn.METHOD)
|
f:write_raw(fn:doc_get(fn.METHOD)
|
||||||
:full_get(get_fallback_fdoc(fn, ftype), true))
|
:full_get(fn:fallback_doc_get(ftype), true))
|
||||||
end
|
end
|
||||||
|
|
||||||
local build_inherits
|
local build_inherits
|
||||||
|
|
Loading…
Reference in New Issue