X-Git-Url: http://nitlanguage.org diff --git a/src/simple_misc_analysis.nit b/src/simple_misc_analysis.nit index bc6c945..35fa66c 100644 --- a/src/simple_misc_analysis.nit +++ b/src/simple_misc_analysis.nit @@ -19,10 +19,20 @@ # * superfluous parentheses # * nested "once" expressions # * use of "while true" instead of "loop" -package simple_misc_analysis +module simple_misc_analysis import toolcontext import parser +import phase + +redef class ToolContext + var simple_misc_analysis_phase: Phase = new SimpleMiscAnalysisPhase(self, null) +end + +private class SimpleMiscAnalysisPhase + super Phase + redef fun process_nmodule(nmodule) do nmodule.do_simple_misc_analysis(toolcontext) +end redef class AModule # Visit the module to detect easy warnings that does not need the metamodel or the importation @@ -38,7 +48,7 @@ private class SimpleMiscVisitor super Visitor redef fun visit(n) do - if n != null then n.accept_simple_misc(self) + n.accept_simple_misc(self) end # Number of nested once