[svn] r5870: nemerle/trunk/ncc/passes.n

nazgul svnadmin at nemerle.org
Wed Nov 2 17:52:40 CET 2005


Log:
Init LexerPipeline only when it was not assigned outside of Passes

Author: nazgul
Date: Wed Nov  2 17:52:08 2005
New Revision: 5870

Modified:
   nemerle/trunk/ncc/passes.n

Modified: nemerle/trunk/ncc/passes.n
==============================================================================
--- nemerle/trunk/ncc/passes.n	(original)
+++ nemerle/trunk/ncc/passes.n	Wed Nov  2 17:52:08 2005
@@ -131,6 +131,8 @@
       Options.Validate ();
       Passes.Solver = Solver ();
       Hierarchy = null;
+      // if it was not initialized outside the Run
+      when (LexingPipeline == null)
       if (Options.IndentationSyntax)
         LexingPipeline = LexerFileIndent;
       else
@@ -140,6 +142,14 @@
         (CleanupOnce.Take ()) ();
     }
 
+    internal CleanUp () : void {
+      /// some cleanup
+      WarningOptions.Clean ();
+      while (! CleanupOnce.IsEmpty)
+        (CleanupOnce.Take ()) ();
+      LexingPipeline = null;
+    }
+    
     internal LoadExternalLibraries () : void {
       unless (Options.DoNotLoadStdlib) {
         LibraryReferenceManager.AddLibrary ("mscorlib");
@@ -173,6 +183,7 @@
      */
     public Run () : void    
     {
+      try {
       InitCompiler ();
       
       ProgressBar (1);
@@ -229,11 +240,10 @@
         
       KillProgressBar ();
       Stats.Run ();
-
-      /// some cleanup
-      WarningOptions.Clean ();
-      while (! CleanupOnce.IsEmpty)
-        (CleanupOnce.Take ()) ();
+      }
+      finally {
+        CleanUp ();
+      }
     }  
   }
 }



More information about the svn mailing list