2004-09-03 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Fri, 3 Sep 2004 13:54:44 +0000 (13:54 -0000)
committerMartin Baulig <martin@novell.com>
Fri, 3 Sep 2004 13:54:44 +0000 (13:54 -0000)
* rootcontext.cs (RootContext.V2): Removed.

svn path=/trunk/mcs/; revision=33280

mcs/mcs/ChangeLog
mcs/mcs/assign.cs
mcs/mcs/cs-parser.jay
mcs/mcs/cs-tokenizer.cs
mcs/mcs/driver.cs
mcs/mcs/ecore.cs
mcs/mcs/expression.cs
mcs/mcs/rootcontext.cs

index a6829ce2796c85509b7da2eca490e4f9e13a1cd8..37f59aece780536160327371b12cfab0a77d01f0 100755 (executable)
@@ -1,3 +1,7 @@
+2004-09-03  Martin Baulig  <martin@ximian.com>
+
+       * rootcontext.cs (RootContext.V2): Removed.
+
 2004-03-23  Martin Baulig  <martin@ximian.com>
 
        * expression.cs (Invocation.OverloadResolve): Added `bool
index 38a9ac7eb75500d96bf1c421eac4e6b72feaf4be..50895673210e78520cfcd91b05c7fe9cb8879d31 100755 (executable)
@@ -406,7 +406,8 @@ namespace Mono.CSharp {
                        if ((source.eclass == ExprClass.Type) && (source is TypeExpr)) {
                                source.Error_UnexpectedKind ("variable or value");
                                return null;
-                       } else if (!RootContext.V2 && (source is MethodGroupExpr)){
+                       } else if ((RootContext.Version == LanguageVersion.ISO_1) &&
+                                  (source is MethodGroupExpr)){
                                ((MethodGroupExpr) source).ReportUsageError ();
                                return null;
 
index a8d8e24c383af3beb7036c087af68b6ad7e6fa38..d1ba397f2dddcb04b6d4e40b847d30695c24aaa8 100755 (executable)
@@ -2536,8 +2536,8 @@ anonymous_method_expression
                        $$ = null;
                } else {
                        create_toplevel_block = false;
-                       if (!RootContext.V2){
-                               Report.Error (-213, lexer.Location, "Anonymous methods are only supported in V2");
+                       if (RootContext.Version == LanguageVersion.ISO_1){
+                               Report.FeatureIsNotStandardized ("anonymous methods");
                                $$ = null;
                        } else 
                                $$ = new AnonymousMethod ((Parameters) $2, (Block) $4, lexer.Location);
@@ -3666,8 +3666,8 @@ yield_statement
                        Report.Error (1003, lexer.Location, "; expected");
                        $$ = null;
                }
-               if (!RootContext.V2){
-                       Report.Error (-222, lexer.Location, "yield statement only available in C# 2.0 mode");
+               if (RootContext.Version == LanguageVersion.ISO_1){
+                       Report.FeatureIsNotStandardized ("yield statement");
                        $$ = null;
                }
                if (iterator_container == null){
@@ -3685,8 +3685,8 @@ yield_statement
                        Report.Error (1003, lexer.Location, "; expected");
                        $$ = null;
                }
-               if (!RootContext.V2){
-                       Report.Error (-222, lexer.Location, "yield statement only available in C# 2.0 mode");
+               if (RootContext.Version == LanguageVersion.ISO_1){
+                       Report.FeatureIsNotStandardized ("yield statement");
                        $$ = null;
                }
                if (iterator_container == null){
index 9b6f4fd34d4c9492df03bf0722aacaf647167ec6..921ae6c648749f6fda45180f27da6c300436f479 100755 (executable)
@@ -1458,7 +1458,7 @@ namespace Mono.CSharp
                        //
                        switch (cmd){
                        case "pragma":
-                               if (RootContext.V2)
+                               if (RootContext.Version != LanguageVersion.ISO_1)
                                        return caller_is_taking;
                                break;
                                
index 4f9e4b0989efa7f159e6ae9c61a0cd3f1660a91f..4ec682ebb5144587876b578a4966edb13ff74a13 100755 (executable)
@@ -644,7 +644,7 @@ namespace Mono.CSharp
 
                static void SetupV2 ()
                {
-                       RootContext.V2 = true;
+                       RootContext.Version = LanguageVersion.Default;
                        defines.Add ("__V2__");
                }
                
index c2519c9766251c314073c3207778f377e5fc6dc0..f127fc0fa9deb16efe605d53b0b592dcb88c0d72 100755 (executable)
@@ -318,7 +318,7 @@ namespace Mono.CSharp {
                                break;
 
                        case ExprClass.MethodGroup:
-                               if (!RootContext.V2){
+                               if (RootContext.Version == LanguageVersion.ISO_1){
                                        if ((flags & ResolveFlags.MethodGroup) == 0) {
                                                ((MethodGroupExpr) e).ReportUsageError ();
                                                return null;
index 897b0c89797b8c5d38c0449d64cd01187992a62e..83eda1606b0a2b4f3976245f20eb720427b86b98 100755 (executable)
@@ -2402,7 +2402,8 @@ namespace Mono.CSharp {
                        //
                        if (oper == Operator.Addition || oper == Operator.Subtraction) {
                                if (l.IsSubclassOf (TypeManager.delegate_type)){
-                                       if (right.eclass == ExprClass.MethodGroup && RootContext.V2){
+                                       if ((right.eclass == ExprClass.MethodGroup) &&
+                                           (RootContext.Version != LanguageVersion.ISO_1)){
                                                Expression tmp = Convert.ImplicitConversionRequired (ec, right, l, loc);
                                                if (tmp == null)
                                                        return null;
index 9628934b91a2188238a2cf26a67aa919f4420154..5e19631ee1ff5da93a06be33f2418fccfc657c5e 100755 (executable)
@@ -69,12 +69,6 @@ namespace Mono.CSharp {
 
                public static bool VerifyClsCompliance = true;
 
-               //
-               // If set, enable C# version 2 features
-               //
-               [Obsolete ("Please use LanguageVersion enum insted")]
-               public static bool V2 = true;
-
                public static LanguageVersion Version = LanguageVersion.Default;
 
                //