If mgroup
is set, then the module search starts from it up to the top level (see paths
);
if mgroup
is null then the module is searched in the top level only.
If no module exists or there is a name conflict, then an error on anode
is displayed and null is returned.
# Get a module by its short name; if required, the module is loaded, parsed and its hierarchies computed.
# If `mgroup` is set, then the module search starts from it up to the top level (see `paths`);
# if `mgroup` is null then the module is searched in the top level only.
# If no module exists or there is a name conflict, then an error on `anode` is displayed and null is returned.
fun get_mmodule_by_name(anode: nullable ANode, mgroup: nullable MGroup, name: String): nullable MModule
do
var mmodule = search_mmodule_by_name(anode, mgroup, name)
if mmodule == null then return null # Forward error
var ast = mmodule.load(self)
if ast == null then return null # Forward error
return mmodule
end
src/loader.nit:278,2--289,4