X-Git-Url: http://nitlanguage.org diff --git a/src/phase.nit b/src/phase.nit index 7cefaf0..d1cc1cb 100644 --- a/src/phase.nit +++ b/src/phase.nit @@ -71,6 +71,9 @@ redef class ToolContext return phases end + # Set of already analyzed modules. + private var phased_modules = new HashSet[AModule] + # Run all registered phases on a set of modules fun run_phases(nmodules: Collection[AModule]) do @@ -85,6 +88,9 @@ redef class ToolContext end for nmodule in nmodules do + if phased_modules.has(nmodule) then continue + phased_modules.add nmodule + self.info("Semantic analysis module {nmodule.location.file.filename}", 2) var vannot = new AnnotationPhaseVisitor @@ -106,7 +112,7 @@ redef class ToolContext phase.process_nclassdef(nclassdef) for npropdef in nclassdef.n_propdefs do assert phase.toolcontext == self - phase.process_npropdef(npropdef) + phase_process_npropdef(phase, npropdef) end end if errcount != self.error_count then @@ -126,6 +132,13 @@ redef class ToolContext var time1 = get_time self.info("*** END SEMANTIC ANALYSIS: {time1-time0} ***", 2) + + errors_info + end + + fun phase_process_npropdef(phase: Phase, npropdef: APropdef) + do + phase.process_npropdef(npropdef) end end