2002-09-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / mbas / namespace.cs
index d310d9a4c80e70f032a8e539e3da4d44080da0c8..d01bde48642adb163637cac88fa5a2cd58b269e2 100644 (file)
@@ -20,7 +20,7 @@ namespace Mono.CSharp {
                string name;
                ArrayList using_clauses;
                Hashtable aliases;
-               bool decl_found = false;
+               public bool DeclarationFound = false;
                
                /// <summary>
                ///   Constructor Takes the current namespace and the
@@ -57,23 +57,13 @@ namespace Mono.CSharp {
                        }
                }
 
-               /// <summary>
-               ///   When a declaration is found in a namespace,
-               ///   we call this function, to emit an error if the
-               ///   program attempts to use a using clause afterwards
-               /// </summary>
-               public void DeclarationFound ()
-               {
-                       decl_found = true;
-               }
-
                /// <summary>
                ///   Records a new namespace for resolving name references
                /// </summary>
-               public void Using (string ns)
+               public void Using (string ns, Location loc)
                {
-                       if (decl_found){
-                               GenericParser.error (1529, "A using clause must precede all other namespace elements");
+                       if (DeclarationFound){
+                               Report.Error (1529, loc, "A using clause must precede all other namespace elements");
                                return;
                        }
 
@@ -127,7 +117,7 @@ namespace Mono.CSharp {
                                if (de.Value == null){
                                        string name = (string) de.Key;
                                        
-                                       GenericParser.error (234, "The type or namespace `" +
+                                       Report.Error (234, "The type or namespace `" +
                                                            name + "' does not exist in the " +
                                                            "class or namespace `" + name + "'");
                                }