forked from enlightenment/efl
docs: namespace generator for funcs in doctree
This commit is contained in:
parent
6f71222084
commit
6de8a1f131
|
@ -260,6 +260,15 @@ M.Function = Node:clone {
|
||||||
return self.func:type_get()
|
return self.func:type_get()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
type_str_get = function(self)
|
||||||
|
return ({
|
||||||
|
[eolian.function_type.PROPERTY] = "property",
|
||||||
|
[eolian.function_type.PROP_GET] = "property",
|
||||||
|
[eolian.function_type.PROP_SET] = "property",
|
||||||
|
[eolian.function_type.METHOD] = "method"
|
||||||
|
})[self:type_get()]
|
||||||
|
end,
|
||||||
|
|
||||||
scope_get = function(self, ft)
|
scope_get = function(self, ft)
|
||||||
return self.func:scope_get(ft)
|
return self.func:scope_get(ft)
|
||||||
end,
|
end,
|
||||||
|
@ -330,6 +339,16 @@ M.Function = Node:clone {
|
||||||
|
|
||||||
is_const = function(self)
|
is_const = function(self)
|
||||||
return self.func:is_const()
|
return self.func:is_const()
|
||||||
|
end,
|
||||||
|
|
||||||
|
nspaces_get = function(self, cl, root)
|
||||||
|
local tbl = cl:nspaces_get()
|
||||||
|
tbl[#tbl + 1] = self:type_str_get()
|
||||||
|
tbl[#tbl + 1] = self:name_get():lower()
|
||||||
|
if root then
|
||||||
|
tbl[#tbl + 1] = true
|
||||||
|
end
|
||||||
|
return tbl
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,16 +58,6 @@ M.gen_nsp_eo = function(eobj, subn, root)
|
||||||
return tbl
|
return tbl
|
||||||
end
|
end
|
||||||
|
|
||||||
M.gen_nsp_func = function(fn, cl, root)
|
|
||||||
local tbl = cl:nspaces_get()
|
|
||||||
tbl[#tbl + 1] = M.funct_to_str[fn:type_get()]
|
|
||||||
tbl[#tbl + 1] = fn:name_get():lower()
|
|
||||||
if root then
|
|
||||||
tbl[#tbl + 1] = true
|
|
||||||
end
|
|
||||||
return tbl
|
|
||||||
end
|
|
||||||
|
|
||||||
M.gen_nsp_ref = function(str, root)
|
M.gen_nsp_ref = function(str, root)
|
||||||
local decl = eolian.declaration_get_by_name(str)
|
local decl = eolian.declaration_get_by_name(str)
|
||||||
if decl then
|
if decl then
|
||||||
|
|
|
@ -367,7 +367,7 @@ local build_functable = function(f, title, ctitle, cl, tp)
|
||||||
local nt = {}
|
local nt = {}
|
||||||
for i, v in ipairs(t) do
|
for i, v in ipairs(t) do
|
||||||
local lbuf = writer.Buffer()
|
local lbuf = writer.Buffer()
|
||||||
lbuf:write_link(eomap.gen_nsp_func(v, cl, true), v:name_get())
|
lbuf:write_link(v:nspaces_get(cl, true), v:name_get())
|
||||||
local pt = propt_to_type[v:type_get()]
|
local pt = propt_to_type[v:type_get()]
|
||||||
if pt then
|
if pt then
|
||||||
lbuf:write_raw(" ")
|
lbuf:write_raw(" ")
|
||||||
|
@ -937,7 +937,7 @@ local build_vallist = function(f, pg, ps, title)
|
||||||
end
|
end
|
||||||
|
|
||||||
build_method = function(fn, cl)
|
build_method = function(fn, cl)
|
||||||
local f = writer.Writer(eomap.gen_nsp_func(fn, cl))
|
local f = writer.Writer(fn:nspaces_get(cl))
|
||||||
stats.check_method(fn, cl)
|
stats.check_method(fn, cl)
|
||||||
|
|
||||||
f:write_h(cl:full_name_get() .. "." .. fn:name_get(), 2)
|
f:write_h(cl:full_name_get() .. "." .. fn:name_get(), 2)
|
||||||
|
@ -965,7 +965,7 @@ build_method = function(fn, cl)
|
||||||
end
|
end
|
||||||
|
|
||||||
build_property = function(fn, cl)
|
build_property = function(fn, cl)
|
||||||
local f = writer.Writer(eomap.gen_nsp_func(fn, cl))
|
local f = writer.Writer(fn:nspaces_get(cl))
|
||||||
|
|
||||||
local fts = eolian.function_type
|
local fts = eolian.function_type
|
||||||
local ft = fn:type_get()
|
local ft = fn:type_get()
|
||||||
|
|
Loading…
Reference in New Issue