Author: marek
Date: 2007-10-09 04:52:04 -0400 (Tue, 09 Oct 2007)
New Revision: 87152

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/anonymous.cs
   trunk/mcs/mcs/driver.cs
   trunk/mcs/mcs/expression.cs
   trunk/mcs/mcs/namespace.cs
   trunk/mcs/mcs/report.cs
Log:
2007-10-09  Marek Safar  <[EMAIL PROTECTED]>
        
        * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
        checks.
        
        * namespace.cs (UsingAlias): Do correct version check.
        


Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2007-10-09 08:41:47 UTC (rev 87151)
+++ trunk/mcs/mcs/ChangeLog     2007-10-09 08:52:04 UTC (rev 87152)
@@ -1,3 +1,10 @@
+2007-10-09  Marek Safar  <[EMAIL PROTECTED]>
+       
+       * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
+       checks.
+       
+       * namespace.cs (UsingAlias): Do correct version check.
+       
 2007-10-08  Marek Safar  <[EMAIL PROTECTED]>
        
        * expresison.cs, ecore.cs: Issue extension method error message when

Modified: trunk/mcs/mcs/anonymous.cs
===================================================================
--- trunk/mcs/mcs/anonymous.cs  2007-10-09 08:41:47 UTC (rev 87151)
+++ trunk/mcs/mcs/anonymous.cs  2007-10-09 08:52:04 UTC (rev 87152)
@@ -1879,6 +1879,9 @@
 
                public static AnonymousTypeClass Create (TypeContainer parent, 
ArrayList parameters, Location loc)
                {
+                       if (RootContext.Version <= LanguageVersion.ISO_2)
+                               Report.FeatureIsNotISO1 (loc, "anonymous 
types");
+                       
                        string name = ClassNamePrefix + types_counter++;
 
                        SimpleName [] t_args = new SimpleName 
[parameters.Count];

Modified: trunk/mcs/mcs/driver.cs
===================================================================
--- trunk/mcs/mcs/driver.cs     2007-10-09 08:41:47 UTC (rev 87151)
+++ trunk/mcs/mcs/driver.cs     2007-10-09 08:52:04 UTC (rev 87152)
@@ -1396,13 +1396,17 @@
                                                SetupV2 ();
                                                return true;
 #if GMCS_SOURCE
+                                       case "iso-2":
+                                               RootContext.Version = 
LanguageVersion.ISO_2;
+                                               return true;
+                                       
                                        case "linq":
                                                RootContext.Version = 
LanguageVersion.LINQ;
                                                
Tokenizer.InitializeLinqKeywords ();
                                                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":

Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2007-10-09 08:41:47 UTC (rev 87151)
+++ trunk/mcs/mcs/expression.cs 2007-10-09 08:52:04 UTC (rev 87152)
@@ -5849,6 +5849,9 @@
                public ImplicitlyTypedArrayCreation (string rank, ArrayList 
initializers, Location loc)
                        : base (null, rank, initializers, loc)
                {
+                       if (RootContext.Version <= LanguageVersion.ISO_2)
+                               Report.FeatureIsNotISO1 (loc, "implicitly typed 
arrays");
+                               
                        if (rank.Length > 2) {
                                while (rank [++dimensions] == ',');
                        } else {

Modified: trunk/mcs/mcs/namespace.cs
===================================================================
--- trunk/mcs/mcs/namespace.cs  2007-10-09 08:41:47 UTC (rev 87151)
+++ trunk/mcs/mcs/namespace.cs  2007-10-09 08:52:04 UTC (rev 87152)
@@ -842,8 +842,7 @@
                                return;
                        }
 
-                       if (RootContext.Version == LanguageVersion.Default &&
-                           name == "global")
+                       if (RootContext.Version != LanguageVersion.ISO_1 && 
name == "global")
                                Report.Warning (440, 2, loc, "An alias named 
`global' will not be used when resolving 'global::';" +
                                        " the global namespace will be used 
instead");
 

Modified: trunk/mcs/mcs/report.cs
===================================================================
--- trunk/mcs/mcs/report.cs     2007-10-09 08:41:47 UTC (rev 87151)
+++ trunk/mcs/mcs/report.cs     2007-10-09 08:52:04 UTC (rev 87152)
@@ -265,15 +265,17 @@
 
                public static void FeatureIsNotISO1 (Location loc, string 
feature)
                {
-                       Report.Error (1644, loc,
-                               "Feature `{0}' cannot be used because it is not 
part of the C# 1.0 language specification",
-                                     feature);
-               }
+                       string version;
+                       if (RootContext.Version == LanguageVersion.ISO_1)
+                               version = "1.0";
+                       else if (RootContext.Version == LanguageVersion.ISO_2)
+                               version = "2.0";
+                       else
+                               throw new InternalErrorException ("Invalid 
feature version", RootContext.Version);
 
-               public static void FeatureRequiresLINQ (Location loc, string 
feature)
-               {
                        Report.Error (1644, loc,
-                                     "Feature `{0}' can only be used if the 
language level is LINQ", feature);
+                               "Feature `{0}' cannot be used because it is not 
part of the C# {1} language specification",
+                                     feature, version);
                }
                
                public static string FriendlyStackTrace (Exception e)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to