This does the same as parse_full
but does only the identification (cf. identify_module
)
# Identify a bunch of modules and groups.
#
# This does the same as `parse_full` but does only the identification (cf. `identify_module`)
fun scan_full(names: Sequence[String]): Array[MModule]
do
var mmodules = new Array[MModule]
for a in names do
# Case of a group (root or sub-directory)
var mgroup = self.identify_group(a)
if mgroup != null then
scan_group(mgroup)
for mg in mgroup.in_nesting.smallers do mmodules.add_all mg.mmodules
continue
end
# Case of a directory that is not a group
var stat = a.to_path.stat
if stat != null and stat.is_dir then
self.toolcontext.info("look in directory {a}", 2)
var fs = a.files
alpha_comparator.sort(fs)
# Try each entry as a group or a module
for f in fs do
if f.first == '.' then continue
var af = a/f
mgroup = identify_group(af)
if mgroup != null then
scan_group(mgroup)
for mg in mgroup.in_nesting.smallers do mmodules.add_all mg.mmodules
continue
end
var mmodule = identify_module(af)
if mmodule != null then
mmodules.add mmodule
else
self.toolcontext.info("ignore file {af}", 2)
end
end
continue
end
var mmodule = identify_module(a)
if mmodule == null then
var le = last_loader_error
if le != null then
toolcontext.error(null, le)
else if a.file_exists then
toolcontext.error(null, "Error: `{a}` is not a Nit source file.")
else
toolcontext.error(null, "Error: cannot find module `{a}`.")
end
continue
end
mmodules.add mmodule
end
return mmodules
end
src/loader.nit:121,2--178,4