- Report.Error (1530, lexer.Location, "Keyword `new' is not allowed on namespace elements");
- }
- | PUBLIC { $$ = Modifiers.PUBLIC; }
- | PROTECTED { $$ = Modifiers.PROTECTED; }
- | INTERNAL { $$ = Modifiers.INTERNAL; }
- | PRIVATE { $$ = Modifiers.PRIVATE; }
- | ABSTRACT { $$ = Modifiers.ABSTRACT; }
- | SEALED { $$ = Modifiers.SEALED; }
- | STATIC { $$ = Modifiers.STATIC; }
- | READONLY { $$ = Modifiers.READONLY; }
- | VIRTUAL { $$ = Modifiers.VIRTUAL; }
- | OVERRIDE { $$ = Modifiers.OVERRIDE; }
- | EXTERN { $$ = Modifiers.EXTERN; }
- | VOLATILE { $$ = Modifiers.VOLATILE; }
- | UNSAFE { $$ = Modifiers.UNSAFE; }
+ Report.Error (1530, GetLocation ($1), "Keyword `new' is not allowed on namespace elements");
+ }
+ | PUBLIC
+ {
+ $$ = Modifiers.PUBLIC;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | PROTECTED
+ {
+ $$ = Modifiers.PROTECTED;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | INTERNAL
+ {
+ $$ = Modifiers.INTERNAL;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | PRIVATE
+ {
+ $$ = Modifiers.PRIVATE;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | ABSTRACT
+ {
+ $$ = Modifiers.ABSTRACT;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | SEALED
+ {
+ $$ = Modifiers.SEALED;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | STATIC
+ {
+ $$ = Modifiers.STATIC;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | READONLY
+ {
+ $$ = Modifiers.READONLY;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | VIRTUAL
+ {
+ $$ = Modifiers.VIRTUAL;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | OVERRIDE
+ {
+ $$ = Modifiers.OVERRIDE;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | EXTERN
+ {
+ $$ = Modifiers.EXTERN;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | VOLATILE
+ {
+ $$ = Modifiers.VOLATILE;
+ StoreModifierLocation ($$, GetLocation ($1));
+ }
+ | UNSAFE
+ {
+ $$ = Modifiers.UNSAFE;
+ StoreModifierLocation ($$, GetLocation ($1));
+ if (!RootContext.Unsafe)
+ Error_UnsafeCodeNotAllowed (GetLocation ($1));
+ }