nitc :: ContractsPhase :: defaultinit
private class ContractsPhase
super Phase
redef fun process_nmodule(nmodule)do
# Check if the contracts are disabled
if toolcontext.opt_no_contract.value then return
nmodule.do_contracts(self.toolcontext)
end
redef fun process_mainmodule(mainmodule: MModule, given_mmodules: SequenceRead[MModule]) do
# Visit all loaded modules `toolcontext.nmodules` to do contract weaving
for nmodule in toolcontext.modelbuilder.nmodules do
nmodule.do_weaving_contracts(self.toolcontext)
end
end
end
src/contracts.nit:35,1--50,3