Author: miguel
Date: 2007-05-01 20:35:36 -0400 (Tue, 01 May 2007)
New Revision: 76552

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/cs-parser.jay
   trunk/mcs/mcs/cs-parser.jay
Log:
This feature is required to compile the Dynamic Language Runtime.

+2007-05-01  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * cs-parser.jay: Allow parameters in operator declarations to
have
+       attributes.



Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2007-05-01 22:15:44 UTC (rev 76551)
+++ trunk/mcs/gmcs/ChangeLog    2007-05-02 00:35:36 UTC (rev 76552)
@@ -1,3 +1,8 @@
+2007-05-01  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * cs-parser.jay: Allow parameters in operator declarations to have
+       attributes. 
+
 2007-04-27  Miguel de Icaza  <[EMAIL PROTECTED]>
 
        * generic.cs (TypeManager.LambdaInfer): now this routine will

Modified: trunk/mcs/gmcs/cs-parser.jay
===================================================================
--- trunk/mcs/gmcs/cs-parser.jay        2007-05-01 22:15:44 UTC (rev 76551)
+++ trunk/mcs/gmcs/cs-parser.jay        2007-05-02 00:35:36 UTC (rev 76552)
@@ -2088,13 +2088,13 @@
        ; 
 operator_declarator
        : type OPERATOR overloadable_operator 
-         open_parens opt_parameter_modifier type IDENTIFIER CLOSE_PARENS
+         open_parens opt_attributes opt_parameter_modifier type IDENTIFIER 
CLOSE_PARENS
          {
                // TODO: wrong location
-               if ((Parameter.Modifier)$5 != Parameter.Modifier.NONE)
+               if ((Parameter.Modifier)$6 != Parameter.Modifier.NONE)
                        Error_ParameterModifierNotValid ((Location) $2);
          
-               LocatedToken lt = (LocatedToken) $7;
+               LocatedToken lt = (LocatedToken) $8;
                Operator.OpType op = (Operator.OpType) $3;
                CheckUnaryOperator (op, lt.Location);
 
@@ -2105,9 +2105,9 @@
                        op = Operator.OpType.UnaryNegation;
 
                Parameter [] pars = new Parameter [1];
-               Expression type = (Expression) $6;
+               Expression type = (Expression) $7;
 
-               pars [0] = new Parameter (type, lt.Value, 
Parameter.Modifier.NONE, null, lt.Location);
+               pars [0] = new Parameter (type, lt.Value, 
Parameter.Modifier.NONE, (Attributes) $5, lt.Location);
 
                current_local_parameters = new Parameters (pars);
 
@@ -2121,25 +2121,25 @@
          }
        | type OPERATOR overloadable_operator
          open_parens 
-               opt_parameter_modifier type IDENTIFIER COMMA
-               opt_parameter_modifier type IDENTIFIER 
+               opt_attributes opt_parameter_modifier type IDENTIFIER COMMA
+               opt_attributes opt_parameter_modifier type IDENTIFIER 
          CLOSE_PARENS
           {
                // TODO: wrong location
-               if ((Parameter.Modifier)$5 != Parameter.Modifier.NONE || 
(Parameter.Modifier)$9 != Parameter.Modifier.NONE)
+               if ((Parameter.Modifier)$6 != Parameter.Modifier.NONE || 
(Parameter.Modifier)$11 != Parameter.Modifier.NONE)
                        Error_ParameterModifierNotValid ((Location) $2);
 
-               LocatedToken ltParam1 = (LocatedToken) $7;
-               LocatedToken ltParam2 = (LocatedToken) $11;
+               LocatedToken ltParam1 = (LocatedToken) $8;
+               LocatedToken ltParam2 = (LocatedToken) $13;
                CheckBinaryOperator ((Operator.OpType) $3, (Location) $2);
 
                Parameter [] pars = new Parameter [2];
 
-               Expression typeL = (Expression) $6;
-               Expression typeR = (Expression) $10;
+               Expression typeL = (Expression) $7;
+               Expression typeR = (Expression) $12;
 
-              pars [0] = new Parameter (typeL, ltParam1.Value, 
Parameter.Modifier.NONE, null, ltParam1.Location);
-              pars [1] = new Parameter (typeR, ltParam2.Value, 
Parameter.Modifier.NONE, null, ltParam2.Location);
+              pars [0] = new Parameter (typeL, ltParam1.Value, 
Parameter.Modifier.NONE, (Attributes) $5, ltParam1.Location);
+              pars [1] = new Parameter (typeR, ltParam2.Value, 
Parameter.Modifier.NONE, (Attributes) $10, ltParam2.Location);
 
               current_local_parameters = new Parameters (pars);
 

Modified: trunk/mcs/mcs/cs-parser.jay
===================================================================
--- trunk/mcs/mcs/cs-parser.jay 2007-05-01 22:15:44 UTC (rev 76551)
+++ trunk/mcs/mcs/cs-parser.jay 2007-05-02 00:35:36 UTC (rev 76552)
@@ -1918,13 +1918,13 @@
        ; 
 operator_declarator
        : type OPERATOR overloadable_operator 
-         open_parens opt_parameter_modifier type IDENTIFIER CLOSE_PARENS
+         open_parens opt_attributes opt_parameter_modifier type IDENTIFIER 
CLOSE_PARENS
          {
                // TODO: wrong location
-               if ((Parameter.Modifier)$5 != Parameter.Modifier.NONE)
+               if ((Parameter.Modifier)$6 != Parameter.Modifier.NONE)
                        Error_ParameterModifierNotValid ((Location) $2);
          
-               LocatedToken lt = (LocatedToken) $7;
+               LocatedToken lt = (LocatedToken) $8;
                Operator.OpType op = (Operator.OpType) $3;
                CheckUnaryOperator (op, lt.Location);
 
@@ -1935,9 +1935,9 @@
                        op = Operator.OpType.UnaryNegation;
 
                Parameter [] pars = new Parameter [1];
-               Expression type = (Expression) $6;
+               Expression type = (Expression) $7;
 
-               pars [0] = new Parameter (type, lt.Value, 
Parameter.Modifier.NONE, null, lt.Location);
+               pars [0] = new Parameter (type, lt.Value, 
Parameter.Modifier.NONE, (Attributes) $5, lt.Location);
 
                current_local_parameters = new Parameters (pars);
 
@@ -1951,25 +1951,25 @@
          }
        | type OPERATOR overloadable_operator
          open_parens 
-               opt_parameter_modifier type IDENTIFIER COMMA
-               opt_parameter_modifier type IDENTIFIER 
+               opt_attributes opt_parameter_modifier type IDENTIFIER COMMA
+               opt_attributes opt_parameter_modifier type IDENTIFIER 
          CLOSE_PARENS
           {
                // TODO: wrong location
-               if ((Parameter.Modifier)$5 != Parameter.Modifier.NONE || 
(Parameter.Modifier)$9 != Parameter.Modifier.NONE)
+               if ((Parameter.Modifier)$6 != Parameter.Modifier.NONE || 
(Parameter.Modifier)$11 != Parameter.Modifier.NONE)
                        Error_ParameterModifierNotValid ((Location) $2);
 
-               LocatedToken ltParam1 = (LocatedToken) $7;
-               LocatedToken ltParam2 = (LocatedToken) $11;
+               LocatedToken ltParam1 = (LocatedToken) $8;
+               LocatedToken ltParam2 = (LocatedToken) $13;
                CheckBinaryOperator ((Operator.OpType) $3, (Location) $2);
 
                Parameter [] pars = new Parameter [2];
 
-               Expression typeL = (Expression) $6;
-               Expression typeR = (Expression) $10;
+               Expression typeL = (Expression) $7;
+               Expression typeR = (Expression) $12;
 
-              pars [0] = new Parameter (typeL, ltParam1.Value, 
Parameter.Modifier.NONE, null, ltParam1.Location);
-              pars [1] = new Parameter (typeR, ltParam2.Value, 
Parameter.Modifier.NONE, null, ltParam2.Location);
+              pars [0] = new Parameter (typeL, ltParam1.Value, 
Parameter.Modifier.NONE, (Attributes) $5, ltParam1.Location);
+              pars [1] = new Parameter (typeR, ltParam2.Value, 
Parameter.Modifier.NONE, (Attributes) $10, ltParam2.Location);
 
               current_local_parameters = new Parameters (pars);
 

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

Reply via email to