X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Fsettings.cs;h=13abbd67c67425faf5f9b3701068ea4c9a2aefc2;hb=bc9d5d113ab7064fc199a2f430751643466cb477;hp=3c7f13bdb13b4b3922fc19d5f57593c2334418e1;hpb=b9afa882093e6c112faa386ab205f90a056866db;p=mono.git diff --git a/mcs/mcs/settings.cs b/mcs/mcs/settings.cs index 3c7f13bdb13..13abbd67c67 100644 --- a/mcs/mcs/settings.cs +++ b/mcs/mcs/settings.cs @@ -29,9 +29,9 @@ namespace Mono.CSharp { V_4 = 4, V_5 = 5, V_6 = 6, - Future = 100, + Experimental = 100, - Default = LanguageVersion.Future, + Default = LanguageVersion.V_6, } public enum RuntimeVersion @@ -150,6 +150,8 @@ namespace Mono.CSharp { public bool BreakOnInternalError; #endregion + public List GetResourceStrings; + public bool ShowFullPaths; // @@ -581,15 +583,21 @@ namespace Mono.CSharp { { bool valid = true; foreach (string wid in text.Split (numeric_value_separator, StringSplitOptions.RemoveEmptyEntries)) { + var warning = wid; + if (warning.Length == 6 && warning [0] == 'C' && warning [1] == 'S') + warning = warning.Substring (2); + int id; - if (!int.TryParse (wid, NumberStyles.AllowLeadingWhite, CultureInfo.InvariantCulture, out id)) { - report.Error (1904, "`{0}' is not a valid warning number", wid); - valid = false; + if (!int.TryParse (warning, NumberStyles.AllowLeadingWhite, CultureInfo.InvariantCulture, out id)) { continue; } - if (report.CheckWarningCode (id, Location.Null)) + if (report.CheckWarningCode (id, Location.Null)) { action (id); + } else { + report.Error (1904, "`{0}' is not a valid warning number", wid); + valid = false; + } } return valid; @@ -1159,9 +1167,12 @@ namespace Mono.CSharp { case "6": settings.Version = LanguageVersion.V_6; return ParseResult.Success; - case "future": - settings.Version = LanguageVersion.Future; + case "experimental": + settings.Version = LanguageVersion.Experimental; return ParseResult.Success; + case "future": + report.Warning (8000, 1, "Language version `future' is no longer supported"); + goto case "6"; } report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 6", value); @@ -1445,7 +1456,7 @@ namespace Mono.CSharp { return ParseResult.Success; default: - if (arg.StartsWith ("--fatal", StringComparison.Ordinal)){ + if (arg.StartsWith ("--fatal", StringComparison.Ordinal)) { int fatal = 1; if (arg.StartsWith ("--fatal=", StringComparison.Ordinal)) int.TryParse (arg.Substring (8), out fatal); @@ -1473,6 +1484,20 @@ namespace Mono.CSharp { return ParseResult.Success; } + if (arg.StartsWith ("--getresourcestrings:", StringComparison.Ordinal)) { + string file = arg.Substring (21).Trim (); + if (file.Length < 1) { + Error_RequiresArgument (arg); + return ParseResult.Error; + } + + if (settings.GetResourceStrings == null) + settings.GetResourceStrings = new List (); + + settings.GetResourceStrings.Add (file); + return ParseResult.Success; + } + return ParseResult.UnknownOption; } } @@ -1542,7 +1567,7 @@ namespace Mono.CSharp { " -help Lists all compiler options (short: -?)\n" + " -keycontainer:NAME The key pair container used to sign the output assembly\n" + " -keyfile:FILE The key file used to strongname the ouput assembly\n" + - " -langversion:TEXT Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Future\n" + + " -langversion:TEXT Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Experimental\n" + " -lib:PATH1[,PATHn] Specifies the location of referenced assemblies\n" + " -main:CLASS Specifies the class with the Main method (short: -m)\n" + " -noconfig Disables implicitly referenced assemblies\n" +