Module:Module introspection: Difference between revisions

Ganaram inukshuk (talk | contribs)
bugfix main function detection
Ganaram inukshuk (talk | contribs)
bugfix main function detection again
Line 229: Line 229:
-- is assumed to be the same name as the module. Module assumes snake_case
-- is assumed to be the same name as the module. Module assumes snake_case
-- is used for function names. (If this fails, it can be entered manually.)
-- is used for function names. (If this fails, it can be entered manually.)
local normalized_name = module_name:gsub("[^%w]", "_")
local normalized_name = module_name:gsub("[^%w]", "_"):lower()
local main_function = args["main_function"] or "_" .. normalized_name -- snake_case assumed
local main_function = args["main_function"] or "_" .. normalized_name
-- Call the introspection function
-- Call the introspection function
Line 239: Line 239:


-- Return combined tables
-- Return combined tables
return dep_table .. '\n' .. func_table
return dep_table .. "\n" .. func_table .. "\n" .. normalized_name
end
end


return p
return p