forked from enlightenment/efl
docs: use new implement based doc API
This commit is contained in:
parent
8207fd9cc5
commit
c2b6fbccbc
|
@ -312,28 +312,10 @@ M.Function = Node:clone {
|
||||||
return self.func:legacy_get(ft)
|
return self.func:legacy_get(ft)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
doc_get = function(self, ft)
|
|
||||||
-- TODO: handle overridden docs sanely
|
|
||||||
return M.Doc(self.func:implement_get():documentation_get(ft))
|
|
||||||
end,
|
|
||||||
|
|
||||||
implement_get = function(self)
|
implement_get = function(self)
|
||||||
return M.Implement(self.func:implement_get())
|
return M.Implement(self.func:implement_get())
|
||||||
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_legacy_only = function(self, ft)
|
is_legacy_only = function(self, ft)
|
||||||
return self.func:is_legacy_only(ft)
|
return self.func:is_legacy_only(ft)
|
||||||
end,
|
end,
|
||||||
|
@ -1296,6 +1278,16 @@ M.Implement = Node:clone {
|
||||||
return M.Doc(self.impl:documentation_get(ftype))
|
return M.Doc(self.impl:documentation_get(ftype))
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
fallback_doc_get = function(self)
|
||||||
|
local ig, is = self:is_prop_get(), self:is_prop_set()
|
||||||
|
if ig and not is then
|
||||||
|
return self:doc_get(M.Function.PROP_GET)
|
||||||
|
elseif is and not ig then
|
||||||
|
return self:doc_get(M.Function.PROP_SET)
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end,
|
||||||
|
|
||||||
is_auto = function(self, ftype)
|
is_auto = function(self, ftype)
|
||||||
return self.impl:is_auto(ftype)
|
return self.impl:is_auto(ftype)
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -145,7 +145,7 @@ M.check_method = function(fn, cl)
|
||||||
stat_incr("mret", false)
|
stat_incr("mret", false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not fn:doc_get(fn.METHOD):exists() then
|
if not fn:implement_get():doc_get(fn.METHOD):exists() then
|
||||||
print_missing(fulln, "method")
|
print_missing(fulln, "method")
|
||||||
stat_incr("method", true)
|
stat_incr("method", true)
|
||||||
else
|
else
|
||||||
|
@ -178,7 +178,9 @@ M.check_property = function(fn, cl, ft)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not fn:doc_get(fn.PROPERTY):exists() and not fn:doc_get(ft):exists() then
|
local pimp = fn:implement_get()
|
||||||
|
|
||||||
|
if not pimp:doc_get(fn.PROPERTY):exists() and not pimp:doc_get(ft):exists() then
|
||||||
print_missing(fulln, pfx .. "etter")
|
print_missing(fulln, pfx .. "etter")
|
||||||
stat_incr(pfx .. "etter", true)
|
stat_incr(pfx .. "etter", true)
|
||||||
else
|
else
|
||||||
|
|
|
@ -174,9 +174,9 @@ local gen_method_sig = function(fn, cl)
|
||||||
local buf = {}
|
local buf = {}
|
||||||
gen_func_namesig(fn, cl, buf, false, false, false)
|
gen_func_namesig(fn, cl, buf, false, false, false)
|
||||||
|
|
||||||
local pimp = fn:implement_get()
|
local fimp = fn:implement_get()
|
||||||
|
|
||||||
if pimp:is_pure_virtual(fn.METHOD) then
|
if fimp:is_pure_virtual(fn.METHOD) then
|
||||||
buf[#buf + 1] = "@pure_virtual "
|
buf[#buf + 1] = "@pure_virtual "
|
||||||
end
|
end
|
||||||
buf[#buf + 1] = "{"
|
buf[#buf + 1] = "{"
|
||||||
|
@ -340,9 +340,10 @@ local build_functable = function(f, title, ctitle, cl, tp)
|
||||||
lbuf:write_raw(" ")
|
lbuf:write_raw(" ")
|
||||||
lbuf:write_i(pt)
|
lbuf:write_i(pt)
|
||||||
end
|
end
|
||||||
|
local fimp = v:implement_get()
|
||||||
nt[#nt + 1] = {
|
nt[#nt + 1] = {
|
||||||
lbuf:finish(),
|
lbuf:finish(),
|
||||||
v:doc_get(v.METHOD):brief_get(v:fallback_doc_get())
|
fimp:doc_get(v.METHOD):brief_get(fimp:fallback_doc_get())
|
||||||
}
|
}
|
||||||
if v:type_str_get() == "property" then
|
if v:type_str_get() == "property" then
|
||||||
build_property(v, cl)
|
build_property(v, cl)
|
||||||
|
@ -951,7 +952,7 @@ build_method = function(fn, cl)
|
||||||
end
|
end
|
||||||
|
|
||||||
f:write_h("Description", 2)
|
f:write_h("Description", 2)
|
||||||
f:write_raw(fn:doc_get(fn.METHOD):full_get(nil, true))
|
f:write_raw(fn:implement_get():doc_get(fn.METHOD):full_get(nil, true))
|
||||||
f:write_nl()
|
f:write_nl()
|
||||||
|
|
||||||
f:write_editable(mns, "description")
|
f:write_editable(mns, "description")
|
||||||
|
@ -971,9 +972,11 @@ build_property = function(fn, cl)
|
||||||
if isget then stats.check_property(fn, cl, fn.PROP_GET) end
|
if isget then stats.check_property(fn, cl, fn.PROP_GET) end
|
||||||
if isset then stats.check_property(fn, cl, fn.PROP_SET) end
|
if isset then stats.check_property(fn, cl, fn.PROP_SET) end
|
||||||
|
|
||||||
local doc = fn:doc_get(fn.PROPERTY)
|
local pimp = fn:implement_get()
|
||||||
local gdoc = fn:doc_get(fn.PROP_GET)
|
|
||||||
local sdoc = fn:doc_get(fn.PROP_SET)
|
local doc = pimp:doc_get(fn.PROPERTY)
|
||||||
|
local gdoc = pimp:doc_get(fn.PROP_GET)
|
||||||
|
local sdoc = pimp:doc_get(fn.PROP_SET)
|
||||||
|
|
||||||
f:write_h("Signature", 2)
|
f:write_h("Signature", 2)
|
||||||
f:write_code(gen_prop_sig(fn, cl))
|
f:write_code(gen_prop_sig(fn, cl))
|
||||||
|
|
Loading…
Reference in New Issue