condition tests passes
[mono.git] / mcs / mcs / driver.cs
index dcb81acfdd1323da1a855198617b32e095a27e34..cf409aea1d4165f6fc7cda77fbc746497981b80c 100644 (file)
@@ -224,13 +224,13 @@ namespace Mono.CSharp
                static void Usage ()
                {
                        Console.WriteLine (
-                               "Mono C# compiler, (C) 2001 - 2007 Novell, Inc.\n" +
+                               "Mono C# compiler, (C) 2001 - 2008 Novell, Inc.\n" +
                                "mcs [options] source-files\n" +
                                "   --about            About the Mono C# compiler\n" +
                                "   -addmodule:M1[,Mn] Adds the module to the generated assembly\n" + 
                                "   -checked[+|-]      Sets default aritmetic overflow context\n" +
                                "   -codepage:ID       Sets code page to the one in ID (number, utf8, reset)\n" +
-                               "   -clscheck[+|-]     Disables CLS Compliance verifications" + Environment.NewLine +
+                               "   -clscheck[+|-]     Disables CLS Compliance verifications\n" +
                                "   -define:S1[;S2]    Defines one or more conditional symbols (short: -d)\n" +
                                "   -debug[+|-], -g    Generate debugging information\n" + 
                                "   -delaysign[+|-]    Only insert the public key into the assembly (no signing)\n" +
@@ -238,7 +238,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 modes: ISO-1 or Default\n" + 
+                               "   -langversion:TEXT  Specifies language version modes: ISO-1, ISO-2, or Default\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 implicit references to assemblies\n" +
@@ -274,7 +274,7 @@ namespace Mono.CSharp
                static void About ()
                {
                        Console.WriteLine (
-                               "The Mono C# compiler is (C) 2001-2007, Novell, Inc.\n\n" +
+                               "The Mono C# compiler is (C) 2001-2008, Novell, Inc.\n\n" +
                                "The compiler source code is released under the terms of the GNU GPL\n\n" +
 
                                "For more information on Mono, visit the project Web site\n" +
@@ -288,11 +288,8 @@ namespace Mono.CSharp
                
                public static int Main (string[] args)
                {
-#if SMCS_SOURCE
-                       RootContext.Version = LanguageVersion.LINQ;
-#else
                        RootContext.Version = LanguageVersion.Default;
-#endif
+
                        Location.InEmacs = Environment.GetEnvironmentVariable ("EMACS") == "t";
 
                        bool ok = MainDriver (args);
@@ -647,7 +644,7 @@ namespace Mono.CSharp
                        //
                        string [] default_config = {
                                "System",
-#if SMCS_SOURCE
+#if NET_2_1
                                "agclr",
                                "System.Core",
                                "System.Silverlight",
@@ -711,12 +708,6 @@ namespace Mono.CSharp
                        Report.WarningLevel = level;
                }
 
-               static void SetupV2 ()
-               {
-                       RootContext.Version = LanguageVersion.Default;
-                       defines.Add ("__V2__");
-               }
-               
                static void Version ()
                {
                        string version = Assembly.GetExecutingAssembly ().GetName ().Version.ToString ();
@@ -1383,29 +1374,29 @@ namespace Mono.CSharp
                                RootContext.StrongNameDelaySign = false;
                                return true;
 
-                       case "/v2":
-                       case "/2":
-                               Console.WriteLine ("The compiler option -2 is obsolete. Please use /langversion instead");
-                               SetupV2 ();
-                               return true;
-                               
                        case "/langversion":
                                switch (value.ToLower (CultureInfo.InvariantCulture)) {
-                                       case "iso-1":
-                                               RootContext.Version = LanguageVersion.ISO_1;
-                                               return true;
-
-                                       case "default":
-                                               SetupV2 ();
-                                               return true;
+                               case "iso-1":
+                                       RootContext.Version = LanguageVersion.ISO_1;
+                                       return true;
+                                       
+                               case "default":
+                                       RootContext.Version = LanguageVersion.Default;
+#if GMCS_SOURCE                                        
+                                       defines.Add ("__V2__");
+#endif
+                                       return true;
 #if GMCS_SOURCE
-                                       case "linq":
-                                               RootContext.Version = LanguageVersion.LINQ;
-                                               Tokenizer.InitializeLinqKeywords ();
-                                               return true;
+                               case "iso-2":
+                                       RootContext.Version = LanguageVersion.ISO_2;
+                                       return true;
+                                       
+                               case "linq":
+                                       Report.Warning (-30, 1, "Deprecated: The `linq' option is no longer required and should not be used");
+                                       return true;
 #endif
                                }
-                               Report.Error (1617, "Invalid option `{0}' for /langversion. It must be either `ISO-1' or `Default'", value);
+                               Report.Error (1617, "Invalid option `{0}' for /langversion. It must be either `ISO-1', `ISO-2' or `Default'", value);
                                return true;
 
                        case "/codepage":