[svn] r6747: nemerle/trunk/ncc: hierarchy/TypeInfo.n parsing/AST.n parsing/MainParser.n

nazgul svnadmin at nemerle.org
Wed Oct 4 19:03:29 CEST 2006


Log:
Assign global env to property-like members during parsing

Author: nazgul
Date: Wed Oct  4 19:03:20 2006
New Revision: 6747

Modified:
   nemerle/trunk/ncc/hierarchy/TypeInfo.n
   nemerle/trunk/ncc/parsing/AST.n
   nemerle/trunk/ncc/parsing/MainParser.n

Modified: nemerle/trunk/ncc/hierarchy/TypeInfo.n
==============================================================================
--- nemerle/trunk/ncc/hierarchy/TypeInfo.n	(original)
+++ nemerle/trunk/ncc/hierarchy/TypeInfo.n	Wed Oct  4 19:03:20 2006
@@ -198,7 +198,10 @@
   
   internal virtual GetObsoletionDetails () : string * bool
   {
-    def (_, parms) = GetModifiers ().FindAttributeWithArgs (this.GlobalEnv.Manager.InternalType.Obsolete_tc, this.GlobalEnv).Value;
+    def obsoletion_tc = this.GlobalEnv.Manager.InternalType.Obsolete_tc;
+    def mods = GetModifiers ();
+    assert (mods != null, this.ToString ());
+    def (_, parms) = mods.FindAttributeWithArgs (obsoletion_tc, this.GlobalEnv).Value;
     mutable msg = null, is_error = false;
     foreach (x in parms) {
       | <[ $(m : string) ]> => msg = m;

Modified: nemerle/trunk/ncc/parsing/AST.n
==============================================================================
--- nemerle/trunk/ncc/parsing/AST.n	(original)
+++ nemerle/trunk/ncc/parsing/AST.n	Wed Oct  4 19:03:20 2006
@@ -216,6 +216,7 @@
     | Extern      = 0x20000
     | CompilerMutable = 0x40000 // field is immutable, but compiler overrides it and can assign something
 
+    | VirtualityModifiers = New %| Abstract %| Virtual %| Override
     | AccessModifiers = Public %| Private %| Protected %| Internal
   }
 

Modified: nemerle/trunk/ncc/parsing/MainParser.n
==============================================================================
--- nemerle/trunk/ncc/parsing/MainParser.n	(original)
+++ nemerle/trunk/ncc/parsing/MainParser.n	Wed Oct  4 19:03:20 2006
@@ -877,6 +877,7 @@
       when (flag_keyword ("implements"))
         impl = comma_separated_list (fun () { parse_expr (TokenStoppers.All) });
 
+      def res = 
       match (peek_token ()) {
         | Token.BracesGroup as group =>
           shift ();
@@ -961,8 +962,7 @@
             }
             pop_stream ("property member");
           }
-          ClassMember.Property (loc, id, mods, ret_type, prop_ty, parms, getter, setter)
-
+          ClassMember.Property (loc, id, mods, ret_type, prop_ty, parms, getter, setter);
 
         | Token.Operator ("=") =>
           shift ();
@@ -973,14 +973,17 @@
             ]>)
           );
           take_attributes_out (ref customs, System.AttributeTargets.Field, true, mods);
-          ClassMember.Field (loc, id, mods, ret_type)
+          ClassMember.Field (loc, id, mods, ret_type);
           
         | Token.EndOfGroup =>
           take_attributes_out (ref customs, System.AttributeTargets.Field, true, mods);
-          ClassMember.Field (loc, id, mods, ret_type)
+          ClassMember.Field (loc, id, mods, ret_type);
           
         | t => Error (t, "expecting `;' or `{ }' in field / property declaration"); null
       }
+      
+      when (res != null) res.Env = env;
+      res
     }
 
     /** Parse event definition from the place after 'event' keyword



More information about the svn mailing list