src: cleanup importations
[nit.git] / src / local_var_init.nit
index 0ef4b4a..4b9a4ab 100644 (file)
 # Require that the scope and the flow analaysis are already performed
 module local_var_init
 
-import scope
 import flow
 
+redef class ToolContext
+       var local_var_init_phase: Phase = new LocalVarInitPhase(self, [flow_phase])
+end
+
+private class LocalVarInitPhase
+       super Phase
+
+       redef fun process_npropdef(npropdef) do npropdef.do_local_var_init(toolcontext)
+end
+
 redef class APropdef
        # Entry point of the whole local variable initialization verifier
        fun do_local_var_init(toolcontext: ToolContext)
@@ -73,7 +82,7 @@ private class LocalVarInitVisitor
 
        redef fun visit(n)
        do
-               if n != null then n.accept_local_var_visitor(self)
+               n.accept_local_var_visitor(self)
        end
 end