[svn] r7696: nemerle/trunk/ncc/hierarchy/CustomAttribute.n

Luntain svnadmin at nemerle.org
Mon Jun 4 12:38:54 CEST 2007


Log:
add a getter method to expose types of attributes

Author: Luntain
Date: Mon Jun  4 12:38:53 2007
New Revision: 7696

Modified:
   nemerle/trunk/ncc/hierarchy/CustomAttribute.n

Modified: nemerle/trunk/ncc/hierarchy/CustomAttribute.n
==============================================================================
--- nemerle/trunk/ncc/hierarchy/CustomAttribute.n	(original)
+++ nemerle/trunk/ncc/hierarchy/CustomAttribute.n	Mon Jun  4 12:38:53 2007
@@ -571,6 +571,19 @@
       loop (custom_attrs)
     }
 
+    public AttributeTypes(env : GlobalEnv) : list[TypeInfo]
+    {
+      def loop (_) {
+        | expr :: exprs =>
+          match (env.Manager.AttributeCompiler.ResolveAttribute (env, expr)) {
+            | Some ((ti, _)) => ti :: loop(exprs)
+            | _ => loop (exprs)
+          }
+        | _ => []
+      }
+      loop (custom_attrs)
+    }
+
     public FindAttribute (looking_for : TypeInfo, env : GlobalEnv) : option [PT.PExpr]
     {
       // find our attribute



More information about the svn mailing list