* rootcontext.cs (RootContext.V2): Removed.
svn path=/trunk/mcs/; revision=33280
+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
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;
$$ = 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);
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){
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){
//
switch (cmd){
case "pragma":
- if (RootContext.V2)
+ if (RootContext.Version != LanguageVersion.ISO_1)
return caller_is_taking;
break;
static void SetupV2 ()
{
- RootContext.V2 = true;
+ RootContext.Version = LanguageVersion.Default;
defines.Add ("__V2__");
}
break;
case ExprClass.MethodGroup:
- if (!RootContext.V2){
+ if (RootContext.Version == LanguageVersion.ISO_1){
if ((flags & ResolveFlags.MethodGroup) == 0) {
((MethodGroupExpr) e).ReportUsageError ();
return null;
//
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;
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;
//