Module:Module introspection: Difference between revisions

Ganaram inukshuk (talk | contribs)
added back dependency code; to be tested...
Ganaram inukshuk (talk | contribs)
mNo edit summary
Line 260: Line 260:
-- Get dependencies and their functions used, then build a table
-- Get dependencies and their functions used, then build a table
local module_deps = p.find_dependencies(code)
local module_deps = p.find_dependencies(code)
local dep_lines = p.make_dependency_table(module_deps)
local dep_table = p.make_dependency_table(module_deps)


-- Get module's functions, then build a table using that information
-- Get module's functions, then build a table using that information
Line 268: Line 268:
-- Return the tables as strings
-- Return the tables as strings
local summary = string.format("'''Introspection summary:''' Module:%s provides %d functions(s).", module_name, #module_functions)
local summary = string.format("'''Introspection summary:''' Module:%s provides %d functions(s).", module_name, #module_functions)
return summary .. "\n" .. table.concat(func_lines, "\n") .. "\n" .. table.concat(dep_lines, "\n")
return summary .. "\n" .. table.concat(func_lines, "\n") .. "\n" .. dep_table
end
end