[svn] r7530: nemerle/trunk/ncc: testsuite/positive/macrolib.n typing/Macros.n

nazgul svnadmin at nemerle.org
Thu Mar 15 21:32:04 CET 2007


Log:
Handle nulls in quotation tranlation. Fixes quoted variants

Author: nazgul
Date: Thu Mar 15 21:31:55 2007
New Revision: 7530

Modified:
   nemerle/trunk/ncc/testsuite/positive/macrolib.n
   nemerle/trunk/ncc/typing/Macros.n

Modified: nemerle/trunk/ncc/testsuite/positive/macrolib.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/positive/macrolib.n	(original)
+++ nemerle/trunk/ncc/testsuite/positive/macrolib.n	Thu Mar 15 21:31:55 2007
@@ -428,6 +428,13 @@
     def tb = Nemerle.Macros.ImplicitCTX().CurrentTypeBuilder;
     def n = Macros.NewSymbol ("log4net_logger");
     tb.Define (<[ decl: private static $(n : name) : object = object(); ]>);
+    tb.GlobalEnv.Define (<[ decl:
+      public variant V
+      {
+        | o1
+      }
+    ]>).Compile ();
+    
     <[ $(n : name) ]>
 }
 

Modified: nemerle/trunk/ncc/typing/Macros.n
==============================================================================
--- nemerle/trunk/ncc/typing/Macros.n	(original)
+++ nemerle/trunk/ncc/typing/Macros.n	Thu Mar 15 21:31:55 2007
@@ -198,6 +198,8 @@
 
       | Splicable.HalfId =>
         Util.ice ("completion not supported here")
+        
+      | null => <[ null ]>
     }
   }
 
@@ -250,7 +252,6 @@
                      ty = $(quoted_expr (ty)),
                      modifiers = Modifiers (mods = NemerleAttributes.None, custom_attrs = [$qattr])) ]>
  
-      // FIXME: currently quoted_attributes returns thing, which cannot be pattern matched                     
       | <[ parameter: ..$attrs $name : $ty ]> =>
         <[ Fun_parm (name = $(quoted_sstring (name)),
                      ty = $(quoted_expr (ty)),
@@ -304,12 +305,11 @@
   
   quoted_attributes (attrs : Modifiers) : PExpr
   {
-    match (attrs) {
+    | null => <[ null ]>          
       | Modifiers where (custom_attrs = [PExpr.Ellipsis (e)]) => quoted_expr (e)
       | _ =>
         <[ Modifiers (($((attrs.mods :> int) : int) :> NemerleAttributes),
                       $(Lift (attrs.custom_attrs, quoted_expr))) ]>
-    };
   }
 
   internal quoted_member (mem : ClassMember) : PExpr {



More information about the svn mailing list