end,
children_get = function(self)
- return revh[self:full_name_get()]
+ return revh[self:full_name_get()] or {}
end,
functions_get = function(self, ft)
return M.Node.nspaces_get(self, self:type_str_get(), root)
end,
+ is_same = function(self, other)
+ return self.class == other.class
+ end,
+
-- static getters
by_name_get = function(name)
tbl[#tbl + 1] = not not root
end
return tbl
+ end,
+
+ is_same = function(self, other)
+ return self.func == other.func
end
}
for cl in eolian.all_classes_get() do
local cln = cl:full_name_get()
for icl in cl:inherits_get() do
+ if icl == "Elm.List" then
+ print("GOT ELM LIST")
+ end
local t = revh[icl]
if not t then
t = {}
f:write_i(buf:finish())
end
+local impls_of = {}
+
+local get_all_impls_of
+get_all_impls_of = function(tbl, cl, fn)
+ for i, imp in ipairs(cl:implements_get()) do
+ local ofn = imp:function_get()
+ if ofn:is_same(fn) then
+ tbl[#tbl + 1] = cl
+ break
+ end
+ end
+ for i, cln in ipairs(cl:children_get()) do
+ local icl = dtree.Class.by_name_get(cln)
+ get_all_impls_of(tbl, icl, fn)
+ end
+end
+
+local write_ilist = function(f, impl, cl)
+ local fn = impl:function_get()
+ local fnn = fn:name_get()
+ local ocl = fn:implement_get():class_get()
+ local onm = ocl:full_name_get() .. "." .. fnn
+ local imps = impls_of[onm]
+ if not imps then
+ imps = {}
+ impls_of[onm] = imps
+ get_all_impls_of(imps, ocl, fn)
+ end
+
+ f:write_h("Implemented by", 2)
+ local t = {}
+ for i, icl in ipairs(imps) do
+ local buf = writer.Buffer()
+ local cfn = icl:full_name_get() .. "." .. fnn
+ if icl:is_same(cl) then
+ buf:write_b(cfn)
+ else
+ buf:write_link(fn:nspaces_get(icl, true), cfn)
+ end
+ t[#t + 1] = buf:finish()
+ end
+ f:write_list(t)
+end
+
build_method = function(impl, cl)
local over = impl:is_overridden(cl)
local fn = impl:function_get()
f:write_editable(mns, "description")
f:write_nl()
+ write_ilist(f, impl, cl)
+ f:write_nl()
+
f:finish()
end
f:write_nl()
end
+ write_ilist(f, impl, cl)
+ f:write_nl()
+
f:finish()
end