2005-10-24 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / gmcs / report.cs
index b493eb743ad106ba7b29dbb9152678adb7dcda25..2cef8ad9491902a6675c93288a2f8f71ee5fb9b6 100644 (file)
@@ -123,15 +123,15 @@ namespace Mono.CSharp {
 
                        public virtual void Print (int code, Location location, string text)
                        {
-                               if (location.Equals (Location.Null)) {
+                               if (location.IsNull) {
                                        Print (code, "", text);
                                        return;
                                }
-                               Print (code, String.Format ("{0}({1})", location.Name, location.Row), text);
+                               Print (code, location.ToString (), text);
                        }
                }
 
-               sealed class WarningMessage: AbstractMessage {
+               sealed class WarningMessage : AbstractMessage {
                        Location loc = Location.Null;
                        readonly int Level;
 
@@ -197,7 +197,7 @@ namespace Mono.CSharp {
                        }
                }
 
-               sealed class ErrorMessage: AbstractMessage {
+               sealed class ErrorMessage : AbstractMessage {
 
                        public override void Print(int code, string location, string text)
                        {
@@ -275,7 +275,7 @@ namespace Mono.CSharp {
                {
                        int[] all_warnings = new int[] {
                                28, 67, 78, 105, 108, 109, 114, 192, 168, 169, 183, 184, 219, 251, 612, 618, 626, 628, 642, 649,
-                               659, 660, 661, 672, 1030, 1522, 1616, 1691, 1692, 1901, 2002, 2023, 3012, 3019, 8024, 8028
+                               659, 660, 661, 672, 1030, 1522, 1616, 1691, 1692, 1901, 2002, 2023, 3012, 3019, 8024, 8028, 3005
                        };
                        
                        foreach (int i in all_warnings) {
@@ -287,7 +287,7 @@ namespace Mono.CSharp {
                
                static public void LocationOfPreviousError (Location loc)
                {
-                       Stderr.WriteLine (String.Format ("{0}({1}) (Location of symbol related to previous error)", loc.Name, loc.Row));
+                       Stderr.WriteLine (String.Format ("{0} (Location of symbol related to previous error)", loc));
                }    
         
                static public void RuntimeMissingSupport (Location loc, string feature) 
@@ -301,7 +301,7 @@ namespace Mono.CSharp {
                /// </summary>
                static public void SymbolRelatedToPreviousError (Location loc, string symbol)
                {
-                       SymbolRelatedToPreviousError (String.Format ("{0}({1})", loc.Name, loc.Row), symbol);
+                       SymbolRelatedToPreviousError (loc.ToString (), symbol);
                }
 
                static public void SymbolRelatedToPreviousError (MemberInfo mi)
@@ -345,12 +345,12 @@ namespace Mono.CSharp {
 
                static void SymbolRelatedToPreviousError (string loc, string symbol)
                {
-                       extra_information.Add (String.Format ("{0}: `{1}' (name of symbol related to previous ", loc, symbol));
+                       extra_information.Add (String.Format ("{0}: `{1}'name of symbol related to previous ", loc, symbol));
                }
 
                public static void ExtraInformation (Location loc, string msg)
                {
-                       extra_information.Add (String.Format ("{0}({1}) {2}", loc.Name, loc.Row, msg));
+                       extra_information.Add (String.Format ("{0} {1}", loc, msg));
                }
 
                public static WarningRegions RegisterWarningRegion (Location location)
@@ -596,7 +596,7 @@ namespace Mono.CSharp {
                        public abstract bool IsEnabled (int code, bool previous);
                }
                
-               class Disable: PragmaCmd
+               class Disable : PragmaCmd
                {
                        int code;
                        public Disable (int line, int code)
@@ -611,7 +611,7 @@ namespace Mono.CSharp {
                        }
                }
 
-               class DisableAll: PragmaCmd
+               class DisableAll : PragmaCmd
                {
                        public DisableAll (int line)
                                : base (line) {}
@@ -622,7 +622,7 @@ namespace Mono.CSharp {
                        }
                }
 
-               class Enable: PragmaCmd
+               class Enable : PragmaCmd
                {
                        int code;
                        public Enable (int line, int code)
@@ -637,7 +637,7 @@ namespace Mono.CSharp {
                        }
                }
 
-               class EnableAll: PragmaCmd
+               class EnableAll : PragmaCmd
                {
                        public EnableAll (int line)
                                : base (line) {}