Define modules init.d.tl file (#61) #69

Merged
Aire-One merged 4 commits from feat/#61 into master 2022-12-30 20:54:55 +01:00
1 changed files with 3 additions and 0 deletions
Showing only changes of commit 6706f0da06 - Show all commits

View File

@ -37,6 +37,8 @@ local function module_lists(
return all_module_infos, module_infos, global_module_infos return all_module_infos, module_infos, global_module_infos
end end
-- The module's children list produced can contain duplicates.
-- We ignore them for now because they are dismissed when building a Map for the generator.
local function modules_tree(modules: List<Module_Info.Module_Info>): Map<string, List<string>> local function modules_tree(modules: List<Module_Info.Module_Info>): Map<string, List<string>>
local tree: Map<string, List<string>> = Map() local tree: Map<string, List<string>> = Map()
for module in modules:iter() do for module in modules:iter() do
@ -127,6 +129,7 @@ filesystem.file_writer.write(
) )
for module, children in tree:iter() do for module, children in tree:iter() do
-- TODO : this map should be coupled with the all_module_infos list
local requires: Map<string, string> = Map() local requires: Map<string, string> = Map()
for child in children:iter() do for child in children:iter() do
local name = child:gmatch(".*%.(.*)$")() local name = child:gmatch(".*%.(.*)$")()