X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fgmcs%2Fmodifiers.cs;h=a430171adb35f81487ea9acba885a7bca4ba749e;hb=f5908bb29972ce75a4c59abce39b3082fdbd64d4;hp=da4bcfdc4bf7ffb2cfea40e70271779191a8b694;hpb=0abc2e6270020edc4a5b4c66f93b4ae582815f20;p=mono.git diff --git a/mcs/gmcs/modifiers.cs b/mcs/gmcs/modifiers.cs index da4bcfdc4bf..a430171adb3 100644 --- a/mcs/gmcs/modifiers.cs +++ b/mcs/gmcs/modifiers.cs @@ -27,6 +27,8 @@ namespace Mono.CSharp { public const int UNSAFE = 0x2000; public const int TOP = 0x2000; + public const int PROPERTY_CUSTOM = 0x4000; // Custom property modifier + // // We use this internally to flag that the method contains an iterator // @@ -76,6 +78,26 @@ namespace Mono.CSharp { return s; } + public static string GetDescription (MethodAttributes ma) + { + if ((ma & MethodAttributes.Assembly) != 0) + return "internal"; + + if ((ma & MethodAttributes.Family) != 0) + return "protected"; + + if ((ma & MethodAttributes.Public) != 0) + return "public"; + + if ((ma & MethodAttributes.FamANDAssem) != 0) + return "protected internal"; + + if ((ma & MethodAttributes.Private) != 0) + return "private"; + + throw new NotImplementedException (ma.ToString ()); + } + public static TypeAttributes TypeAttr (int mod_flags, bool is_toplevel) { TypeAttributes t = 0; @@ -198,11 +220,7 @@ namespace Mono.CSharp { int a = mod; if ((mod & Modifiers.UNSAFE) != 0){ - if (!RootContext.Unsafe){ - Report.Error (227, l, - "Unsafe code requires the -unsafe command " + - "line option to be specified"); - } + RootContext.CheckUnsafeOption (l); } // @@ -242,7 +260,7 @@ namespace Mono.CSharp { public static void Error_InvalidModifier (Location l, string name) { - Report.Error (106, l, "the modifier " + name + " is not valid for this item"); + Report.Error (106, l, "The modifier `" + name + "' is not valid for this item"); } } }