[svn] r6242: nemerle/trunk/ncc: CompilationOptions.n misc/PrettyPrint.n

malekith svnadmin at nemerle.org
Sun May 7 20:29:01 CEST 2006


Log:
Add new -pet option to print type of printed expressions.

Author: malekith
Date: Sun May  7 20:28:58 2006
New Revision: 6242

Modified:
   nemerle/trunk/ncc/CompilationOptions.n
   nemerle/trunk/ncc/misc/PrettyPrint.n

Modified: nemerle/trunk/ncc/CompilationOptions.n
==============================================================================
--- nemerle/trunk/ncc/CompilationOptions.n	(original)
+++ nemerle/trunk/ncc/CompilationOptions.n	Sun May  7 20:28:58 2006
@@ -37,6 +37,7 @@
     public mutable OutputFileName : string;
     public mutable XmlDoc : bool;
     public mutable DumpTypedTree : bool;
+    public mutable PrintExpressionsType : bool;
     public mutable DumpNamedMethod : string;
     public mutable DumpDecisionTree : bool;
     public mutable NewMatchingCompiler : bool;
@@ -99,6 +100,7 @@
       OutputFileName = "out.exe";
       XmlDoc = false;
       DumpTypedTree = false;
+      PrintExpressionsType = false;
       TargetIsLibrary = false;
       TargetIsWinexe = false;
       IgnoreConfusion = false;
@@ -512,6 +514,12 @@
                      handler = fun () {
                        Options.DumpTypedTree = true; 
                      }),
+        Getopt.CliOption.Flag (name = "-print-expressions-type", 
+                     aliases = ["-pet"],
+                     help = "Pretty prints types of expressions in dump (use with -dt)",
+                     handler = fun () {
+                       Options.PrintExpressionsType = true; 
+                     }),
         Getopt.CliOption.Flag (name = "-additional-debug", 
                      aliases = ["-ad"],
                      help = "NOHELP",

Modified: nemerle/trunk/ncc/misc/PrettyPrint.n
==============================================================================
--- nemerle/trunk/ncc/misc/PrettyPrint.n	(original)
+++ nemerle/trunk/ncc/misc/PrettyPrint.n	Sun May  7 20:28:58 2006
@@ -1201,7 +1201,8 @@
             append ("(Delayed)")
       }
 
-      //append ($"{$(expr.Type)}");
+      when (Options.PrintExpressionsType)
+        append ($"{$(expr.Type)}");
     }
     
 



More information about the svn mailing list