// FIXME: currently our class library does not support custom number format strings
//
using System;
+using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Specialized;
/// Whether to dump a stack trace on errors.
/// </summary>
static public bool Stacktrace;
+
+ static public TextWriter Stderr = Console.Error;
//
// If the 'expected' error code is reported then the
/// </summary>
static StringCollection extra_information = new StringCollection ();
+ public static void Reset ()
+ {
+ Errors = Warnings = 0;
+ WarningsAreErrors = false;
+ warning_ignore_table = null;
+ warning_regions_table = null;
+ }
+
abstract class AbstractMessage {
static void Check (int code)
msg.Append (' ');
}
msg.AppendFormat ("{0} CS{1:0000}: {2}", MessageType, code, text);
- Console.Error.WriteLine (msg.ToString ());
+ Stderr.WriteLine (msg.ToString ());
foreach (string s in extra_information)
- Console.Error.WriteLine (s + MessageType);
+ Stderr.WriteLine (s + MessageType);
extra_information.Clear ();
static public void LocationOfPreviousError (Location loc)
{
- Console.Error.WriteLine (String.Format ("{0}({1}) (Location of symbol related to previous error)", loc.Name, loc.Row));
+ Stderr.WriteLine (String.Format ("{0}({1}) (Location of symbol related to previous error)", loc.Name, loc.Row));
}
static public void RuntimeMissingSupport (Location loc, string feature)
return;
}
- string name = String.Concat (temp_ds.Name, ".", mi.Name);
- MemberCore mc = temp_ds.GetDefinition (name);
+ MemberCore mc = temp_ds.GetDefinition (mi.Name);
SymbolRelatedToPreviousError (mc);
}
}
static public void Error (int code, Location loc, string format, params object[] args)
{
- ErrorMessage e = new ErrorMessage ();
- e.Print (code, loc, String.Format (format, args));
+ Error (code, loc, String.Format (format, args));
+ }
+
+ static public void Error (int code, Location loc, string error)
+ {
+ new ErrorMessage ().Print (code, loc, error);
}
static public void SetIgnoreWarning (int code)