Fix comment typo
[mono.git] / mcs / mcs / context.cs
index 01cad1f2e8c26872939041e3b2ff624c6e44619f..921770cce7820a54293a952da7d94f83c30c18d4 100644 (file)
@@ -13,12 +13,6 @@ using System;
 using System.Collections.Generic;
 using System.IO;
 
-#if STATIC
-using IKVM.Reflection.Emit;
-#else
-using System.Reflection.Emit;
-#endif
-
 namespace Mono.CSharp
 {
        public enum LookupMode
@@ -58,7 +52,7 @@ namespace Mono.CSharp
 
                string GetSignatureForError ();
 
-               IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope);
+               ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity);
                FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc);
                FullNamedExpression LookupNamespaceAlias (string name);
        }
@@ -75,18 +69,7 @@ namespace Mono.CSharp
        {
                FlowBranching current_flow_branching;
 
-               TypeSpec return_type;
-
-               /// <summary>
-               ///   The location where return has to jump to return the
-               ///   value
-               /// </summary>
-               public Label ReturnLabel;       // TODO: It's emit dependant
-
-               /// <summary>
-               ///   If we already defined the ReturnLabel
-               /// </summary>
-               public bool HasReturnLabel;
+               readonly TypeSpec return_type;
 
                public int FlowOffset;
 
@@ -116,6 +99,10 @@ namespace Mono.CSharp
                        get { return current_flow_branching; }
                }
 
+               public TypeSpec ReturnType {
+                       get { return return_type; }
+               }
+
                // <summary>
                //   Starts a new code branching.  This inherits the state of all local
                //   variables and parameters from the current branching.
@@ -166,6 +153,13 @@ namespace Mono.CSharp
                        return branching;
                }
 
+               public FlowBranchingAsync StartFlowBranching (AsyncInitializer asyncBody, FlowBranching parent)
+               {
+                       var branching = new FlowBranchingAsync (parent, asyncBody);
+                       current_flow_branching = branching;
+                       return branching;
+               }
+
                public FlowBranchingToplevel StartFlowBranching (ParametersBlock stmt, FlowBranching parent)
                {
                        FlowBranchingToplevel branching = new FlowBranchingToplevel (parent, stmt);
@@ -196,19 +190,11 @@ namespace Mono.CSharp
                        current_flow_branching = current_flow_branching.Parent;
                }
 
-               //
-               // This method is used during the Resolution phase to flag the
-               // need to define the ReturnLabel
-               //
+#if !STATIC
                public void NeedReturnLabel ()
                {
-                       if (!HasReturnLabel)
-                               HasReturnLabel = true;
-               }
-
-               public TypeSpec ReturnType {
-                       get { return return_type; }
                }
+#endif
        }
 
        //
@@ -267,6 +253,8 @@ namespace Mono.CSharp
 
                        UsingInitializerScope = 1 << 12,
 
+                       LockScope = 1 << 13,
+
                        /// <summary>
                        ///   Whether control flow analysis is enabled
                        /// </summary>
@@ -517,9 +505,9 @@ namespace Mono.CSharp
                        return MemberContext.GetSignatureForError ();
                }
 
-               public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope)
+               public ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)
                {
-                       return MemberContext.LookupExtensionMethod (extensionType, name, arity, ref scope);
+                       return MemberContext.LookupExtensionMethod (extensionType, name, arity);
                }
 
                public FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)
@@ -683,18 +671,11 @@ namespace Mono.CSharp
                        /// </summary>
                        CheckedScope = 1 << 0,
 
-                       /// <summary>
-                       ///   The constant check state is always set to `true' and cant be changed
-                       ///   from the command line.  The source code can change this setting with
-                       ///   the `checked' and `unchecked' statements and expressions. 
-                       /// </summary>
-                       ConstantCheckState = 1 << 1,
-
-                       AllCheckStateFlags = CheckedScope | ConstantCheckState,
-
                        OmitDebugInfo = 1 << 2,
 
-                       ConstructorScope = 1 << 3
+                       ConstructorScope = 1 << 3,
+
+                       AsyncBody = 1 << 4
                }
 
                // utility helper for CheckExpr, UnCheckExpr, Checked and Unchecked statements
@@ -723,7 +704,7 @@ namespace Mono.CSharp
                        }
                }
 
-               Options flags;
+               protected Options flags;
 
                public bool HasSet (Options options)
                {