[svn] r5999: nemerle/trunk/ncc/generation/Typer4.n

malekith svnadmin at nemerle.org
Tue Dec 6 12:44:44 CET 2005


Log:
Use logging macros instead of conditional compilaion.

Author: malekith
Date: Tue Dec  6 12:44:44 2005
New Revision: 5999

Modified:
   nemerle/trunk/ncc/generation/Typer4.n

Modified: nemerle/trunk/ncc/generation/Typer4.n
==============================================================================
--- nemerle/trunk/ncc/generation/Typer4.n	(original)
+++ nemerle/trunk/ncc/generation/Typer4.n	Tue Dec  6 12:44:44 2005
@@ -28,16 +28,19 @@
 
 using Nemerle.Collections;
 using Nemerle.Utility;
+using Nemerle.Logging;
 
 using Nemerle.Compiler;
 using Nemerle.Compiler.Typedtree;
 using Nemerle.Compiler.SolverMacros;
 
+
 #if DEBUG
- // #define DEBUG_STV
   #define CHECK_STV
 #endif
 
+[assembly: LogFlag (STV, false)]
+
 namespace Nemerle.Compiler
 {
   class Typer4
@@ -84,9 +87,7 @@
                 when (tv.current_type == null)
                   tv.current_type = current_type;
               }
-              #if DEBUG_STV
-                Message.Debug ($"check header $the_method");
-              #endif
+              log (STV, $"check header $the_method");
               foreach (parm in current_fun.parms)
                 CheckSTV (parm.ty);
               CheckSTV (current_fun.ret_type);
@@ -208,29 +209,19 @@
 
     static Throws (expr : TExpr, allow_try : bool = false) : bool
     {
-      #if DEBUG_STV
-        Message.Debug (expr.loc, $ "{ throws: $expr $(expr.GetType()) ");
-      #endif
+      log (STV, expr.loc, $ "{ throws: $expr $(expr.GetType()) ");
       #if CHECK_STV
         when (expr.ty != null) {
-          #if DEBUG_STV
-            Message.Debug (expr.loc, $ "( : $(expr.Type)");
-          #endif
+          log (STV, expr.loc, $ "( : $(expr.Type)");
           CheckSTV (expr.Type);
-          #if DEBUG_STV
-            Message.Debug (expr.loc, $ "done )");
-          #endif
+          log (STV, expr.loc, $ "done )");
         }
         match (expr) {
           | DefValIn (name, _, _)
           | TryWith (_, name, _) =>
-            #if DEBUG_STV
-              Message.Debug (expr.loc, $ "( name($(name)) : $(name.Type)");
-            #endif
+            log (STV, expr.loc, $ "( name($(name)) : $(name.Type)");
             CheckSTV (name.Type);
-            #if DEBUG_STV
-              Message.Debug (expr.loc, $ "done )");
-            #endif
+            log (STV, expr.loc, $ "done )");
           | _ => {}
         }
       #endif
@@ -406,9 +397,7 @@
         }
 
       expr.Throws = res;
-      #if DEBUG_STV
-        Message.Debug (expr.loc, $ "throws } $(expr.GetType()) ");
-      #endif
+      log (STV, expr.loc, $ "throws } $(expr.GetType()) ");
       res
     }
     #endregion



More information about the svn mailing list