Fix #77035.
[mono.git] / mcs / mcs / location.cs
index dd201fe7dd5cf541acd47b2a0937e89eef28f85b..f69ee3c69807df87490577a3f7cfa62a8af79e50 100644 (file)
@@ -88,8 +88,9 @@ namespace Mono.CSharp {
                static int column_mask;
                static Checkpoint [] checkpoints;
                static int checkpoint_index;
-
+               
                public readonly static Location Null = new Location (-1);
+               public static bool InEmacs;
                
                static Location ()
                {
@@ -118,9 +119,9 @@ namespace Mono.CSharp {
                                int id = (int) source_files [path];
                                string other_name = ((SourceFile) source_list [id - 1]).Name;
                                if (name.Equals (other_name))
-                                       Report.Warning (2002, "Source file `{0}' specified multiple times", name);
+                                       Report.Warning (2002, 1, "Source file `{0}' specified multiple times", other_name);
                                else
-                                       Report.Warning (2002, "Source filenames `{0}' and `{1}' both refer to the same file: {2}", name, other_name, path);
+                                       Report.Warning (2002, 1, "Source filenames `{0}' and `{1}' both refer to the same file: {2}", name, other_name, path);
                                return;
                        }
 
@@ -205,7 +206,8 @@ namespace Mono.CSharp {
                        if (row <= 0)
                                token = 0;
                        else {
-                               column &= column_mask;
+                               if (column > 255)
+                                       column = 255;
                                int target = -1;
                                int delta = 0;
                                int max = checkpoint_index < 10 ?
@@ -244,7 +246,7 @@ namespace Mono.CSharp {
 
                public override string ToString ()
                {
-                       if (column_bits == 0)
+                       if (column_bits == 0 || InEmacs)
                                return Name + "(" + Row + "):";
                        else
                                return Name + "(" + Row + "," + Column +