Author: marek
Date: 2007-08-28 06:11:29 -0400 (Tue, 28 Aug 2007)
New Revision: 84934

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

        * cs-parser.jay: Anonymous type arguments can be simple name, syntax 
error
        handling.


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2007-08-28 09:47:17 UTC (rev 84933)
+++ trunk/mcs/gmcs/ChangeLog    2007-08-28 10:11:29 UTC (rev 84934)
@@ -1,3 +1,8 @@
+2007-08-28  Marek Safar  <[EMAIL PROTECTED]>
+
+       * cs-parser.jay: Anonymous type arguments can be simple name, syntax 
error
+       handling.
+
 2007-08-23  Marek Safar  <[EMAIL PROTECTED]>
 
        * generic.cs (TypeInferenceV3.DoSecondPhase): Handle nested delegate

Modified: trunk/mcs/gmcs/cs-parser.jay
===================================================================
--- trunk/mcs/gmcs/cs-parser.jay        2007-08-28 09:47:17 UTC (rev 84933)
+++ trunk/mcs/gmcs/cs-parser.jay        2007-08-28 10:11:29 UTC (rev 84934)
@@ -3527,20 +3527,27 @@
        ;
 
 anonymous_type_parameter
-       : variable_declarator
+       : IDENTIFIER ASSIGN variable_initializer
          {
-               VariableDeclaration v = (VariableDeclaration) $1;
-               Expression e = v.expression_or_array_initializer;
-               if (e == null) {
-                       e = new LocalVariableReference (current_block, 
v.identifier, lexer.Location);
-               }
-               $$ = new AnonymousTypeParameter (e, v.identifier, v.Location);
+               LocatedToken lt = (LocatedToken)$1;
+               $$ = new AnonymousTypeParameter ((Expression)$3, lt.Value, 
lt.Location);
          }
+       | IDENTIFIER
+         {
+               LocatedToken lt = (LocatedToken)$1;
+               $$ = new AnonymousTypeParameter (new SimpleName (lt.Value, 
lt.Location),
+                       lt.Value, lt.Location);
+         }
        | member_access
          {
                MemberAccess ma = (MemberAccess) $1;
                $$ = new AnonymousTypeParameter (ma, ma.Identifier, 
ma.Location);
          }
+       | error
+         {
+               Report.Error (746, lexer.Location, "Invalid anonymous type 
member declarator. " +
+               "Anonymous type members must be a member assignment, simple 
name or member access expression");
+         }
        ;
 
 opt_rank_specifier

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

Reply via email to