nitc :: CmdMainCompile :: mmodule_main
mmodule
has a main
method?
# Does `mmodule` has a `main` method?
private fun mmodule_main(mmodule: MModule): nullable SourceFile do
for mclassdef in mmodule.mclassdefs do
if mclassdef.name != "Sys" then continue
for mpropdef in mclassdef.mpropdefs do
if mpropdef.name == "main" then return mmodule.location.file
end
end
return null
end
src/doc/commands/commands_main.nit:99,2--108,4