nitc :: CmdMains :: mmodule_has_main
mmodule
has a main
method?
# Does `mmodule` has a `main` method?
private fun mmodule_has_main(mmodule: MModule): Bool do
for mclassdef in mmodule.collect_redef_mclassdefs(filter) do
if mclassdef.name != "Sys" then continue
for mpropdef in mclassdef.collect_redef_mpropdefs(filter) do
if mpropdef.name == "main" then return true
end
end
return false
end
src/doc/commands/commands_main.nit:51,2--60,4