@ -544,7 +544,7 @@ namespace_declaration
@@ -544,7 +544,7 @@ namespace_declaration
var name = (MemberName) $3;
var ns = new NamespaceContainer (name, current_namespace);
lbag.AddLocation (current_container , GetLocation ($2));
lbag.AddLocation (ns , GetLocation ($2));
current_namespace.AddTypeContainer (ns);
}
;
@ -1015,6 +1015,14 @@ constant_declaration
@@ -1015,6 +1015,14 @@ constant_declaration
lbag.AddMember (current_field, GetModifierLocations (), GetLocation ($3), GetLocation ($9));
current_field = null;
}
| opt_attributes
opt_modifiers
CONST type error
{
Error_SyntaxError (yyToken);
current_type.AddMember (new Const (current_type, (FullNamedExpression) $4, (Modifiers) $2, MemberName.Null, (Attributes) $1));
}
;
opt_constant_declarators
@ -1242,10 +1250,7 @@ method_declaration
@@ -1242,10 +1250,7 @@ method_declaration
if (doc_support)
Lexer.doc_state = XmlCommentState.NotAllowed;
// Add it early in the case of body being eof for full ast
Method m = (Method) $1;
async_block = (m.ModFlags & Modifiers.ASYNC) != 0;
current_type.AddMember (m);
// Was added earlier in the case of body being eof for full ast
}
method_body
{
@ -1285,26 +1290,35 @@ method_header
@@ -1285,26 +1290,35 @@ method_header
}
opt_formal_parameter_list CLOSE_PARENS
{
lexer.ConstraintsParsing = true;
}
opt_type_parameter_constraints_clauses
{
lexer.ConstraintsParsing = false;
valid_param_mod = 0;
MemberName name = (MemberName) $4;
current_local_parameters = (ParametersCompiled) $7;
var method = Method.Create (current_type, (FullNamedExpression) $3, (Modifiers) $2,
name, current_local_parameters, (Attributes) $1, $10 != null);
name, current_local_parameters, (Attributes) $1);
current_type.AddMember (method);
async_block = (method.ModFlags & Modifiers.ASYNC) != 0;
if ($10 != null)
method.SetConstraints ((List<Constraints>) $10);
if (doc_support)
method.DocComment = Lexer.consume_doc_comment ();
lbag.AddMember (method, GetModifierLocations (), GetLocation ($5), GetLocation ($8));
$$ = method;
lexer.ConstraintsParsing = true;
}
opt_type_parameter_constraints_clauses
{
lexer.ConstraintsParsing = false;
if ($10 != null) {
var method = (Method) $9;
method.SetConstraints ((List<Constraints>) $10);
}
$$ = $9;
}
| opt_attributes
opt_modifiers
@ -1335,7 +1349,9 @@ method_header
@@ -1335,7 +1349,9 @@ method_header
modifiers |= Modifiers.PARTIAL;
var method = Method.Create (current_type, new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($4)),
modifiers, name, current_local_parameters, (Attributes) $1, $11 != null);
modifiers, name, current_local_parameters, (Attributes) $1);
current_type.AddMember (method);
if ($11 != null)
method.SetConstraints ((List<Constraints>) $11);
@ -1357,7 +1373,9 @@ method_header
@@ -1357,7 +1373,9 @@ method_header
"Member modifier `{0}' must precede the member type and name", ModifiersExtensions.Name ((Modifiers) $4));
var method = Method.Create (current_type, (FullNamedExpression) $3,
0, name, (ParametersCompiled) $7, (Attributes) $1, false);
0, name, (ParametersCompiled) $7, (Attributes) $1);
current_type.AddMember (method);
current_local_parameters = (ParametersCompiled) $7;
@ -1376,7 +1394,9 @@ method_header
@@ -1376,7 +1394,9 @@ method_header
MemberName name = (MemberName) $4;
var method = Method.Create (current_type, (FullNamedExpression) $3, (Modifiers) $2,
name, current_local_parameters, (Attributes) $1, false);
name, current_local_parameters, (Attributes) $1);
current_type.AddMember (method);
if (doc_support)
method.DocComment = Lexer.consume_doc_comment ();
@ -2392,6 +2412,14 @@ event_declaration
@@ -2392,6 +2412,14 @@ event_declaration
current_event = null;
current_local_parameters = null;
}
| opt_attributes
opt_modifiers
EVENT type error
{
Error_SyntaxError (yyToken);
current_type.AddMember (new EventField (current_type, (FullNamedExpression) $4, (Modifiers) $2, MemberName.Null, (Attributes) $1));
}
;
opt_event_initializer