// Miguel de Icaza
// Atsushi Enomoto <atsushi@ximian.com>
//
-// (C) 2001 Ximian, Inc.
-// (C) 2005 Novell, Inc.
+// Copyright 2001 Ximian, Inc.
+// Copyright 2005 Novell, Inc.
//
using System;
public readonly string Path;
public readonly int Index;
public SourceFileEntry SourceFileEntry;
- public bool HasLineDirective;
public SourceFile (string name, string path, int index)
{
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 ()
{
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;
}
// </remarks>
static public SourceFile LookupFile (string name)
{
- string path = name == "" ? "" : Path.GetFullPath (name);
+ string path = name.Length == 0 ? string.Empty : Path.GetFullPath (name);
if (!source_files.Contains (path)) {
if (source_count >= (1 << checkpoint_bits))
return (SourceFile) source_list [index - 1];
}
- static public void Push (SourceFile file, int line)
+ static public void Push (SourceFile file)
{
current_source = file.Index;
// File is always pushed before being changed.
// and code generation to register all the source files with the
// symbol writer.
// </remarks>
- static public void DefineSymbolDocuments (SymbolWriter symwriter)
+ static public void DefineSymbolDocuments (MonoSymbolWriter symwriter)
{
foreach (SourceFile file in source_list) {
file.SourceFileEntry = symwriter.DefineDocument (file.Path);
}
checkpoints [checkpoint_index] = new Checkpoint (file, row);
}
-
+
public override string ToString ()
{
- if (column_bits == 0)
- return Name + "(" + Row + "):";
+ if (column_bits == 0 || InEmacs)
+ return Name + "(" + Row.ToString () + "):";
else
- return Name + "(" + Row + "," + Column +
+ return Name + "(" + Row.ToString () + "," + Column.ToString () +
(Column == column_mask ? "+):" : "):");
}