Author: marek
Date: 2007-06-14 16:51:51 -0400 (Thu, 14 Jun 2007)
New Revision: 79630

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/cs-parser.jay
Log:
2007-06-14  Marek Safar  <[EMAIL PROTECTED]>

        * cs-parser.jay: Assembly and module attributes must precede all other
        elements except using clauses and extern alias declarations.



Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2007-06-14 20:51:05 UTC (rev 79629)
+++ trunk/mcs/gmcs/ChangeLog    2007-06-14 20:51:51 UTC (rev 79630)
@@ -1,3 +1,8 @@
+2007-06-14  Marek Safar  <[EMAIL PROTECTED]>
+
+       * cs-parser.jay: Assembly and module attributes must precede all other
+       elements except using clauses and extern alias declarations.
+
 2007-06-08  Marek Safar  <[EMAIL PROTECTED]>
 
        * cs-parser.jay: Uses newly defined GroupBy class.

Modified: trunk/mcs/gmcs/cs-parser.jay
===================================================================
--- trunk/mcs/gmcs/cs-parser.jay        2007-06-14 20:51:05 UTC (rev 79629)
+++ trunk/mcs/gmcs/cs-parser.jay        2007-06-14 20:51:51 UTC (rev 79630)
@@ -554,8 +554,16 @@
 global_attributes
        : attribute_sections
 {
-       if ($1 != null)
-               CodeGen.Assembly.AddAttributes (((Attributes)$1).Attrs);
+       if ($1 != null) {
+               Attributes attrs = (Attributes)$1;
+               if (global_attrs_enabled) {
+                       CodeGen.Assembly.AddAttributes (attrs.Attrs);
+               } else {
+                       foreach (Attribute a in attrs.Attrs) {
+                               Report.Error (1730, a.Location, "Assembly and 
module attributes must precede all other elements except using clauses and 
extern alias declarations");
+                       }
+               }
+       }
 
        $$ = $1;
 }
@@ -707,7 +715,7 @@
 
                if (current_attr_target == String.Empty)
                        $$ = null;
-               else if (current_attr_target == "assembly" || 
current_attr_target == "module")
+               else if (global_attrs_enabled && (current_attr_target == 
"assembly" || current_attr_target == "module"))
                        // FIXME: supply "nameEscaped" parameter here.
                        $$ = new GlobalAttribute (current_namespace, 
current_attr_target,
                                                  left_expr, identifier, 
arguments, mname.Location, lexer.IsEscapedIdentifier (mname.Location));

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to