using System.Collections;
using System.Diagnostics;
-namespace Mono.CSharp {
+namespace Mono.MonoBASIC {
/// <summary>
/// This class is used to report errors and warnings t te user.
static void Check (int code)
{
- if (code == expected_error){
+ if (code == expected_error)
+ {
if (Fatal)
throw new Exception ();
}
}
- static public void RealError (string msg)
+ static private void RealError (string msg)
{
Errors++;
Console.WriteLine (msg);
static public void Error (int code, Location l, string text)
{
string msg = String.Format (
- "{0}({1}) error BC{2:0000}: {3}", l.Name, l.Row, code, text);
-// "{0}({1}) error BC{2}: {3}", l.Name, l.Row, code, text);
+ "{0}({1},{2}) error BC{3:0000}: {4}", l.Name, l.Row, l.Col, code, text);
RealError (msg);
Check (code);
if (WarningsAreErrors)
Error (code, l, text);
else {
- string row;
-
if (Location.IsNull (l))
- row = "";
+ Console.WriteLine(String.Format("{0} warning BC{1:0000}: {2}",
+ l.Name, code, text));
else
- row = l.Row.ToString ();
-
- Console.WriteLine (String.Format (
- "{0}({1}) warning BC{2:0000}: {3}",
-// "{0}({1}) warning BC{2}: {3}",
- l.Name, row, code, text));
+ Console.WriteLine(String.Format("{0}({1},{2}) warning BC{3:0000}: {4}",
+ l.Name, l.Row, l.Col, code, text));
Warnings++;
Check (code);
static public void Error (int code, string text)
{
string msg = String.Format ("error BC{0:0000}: {1}", code, text);
-// string msg = String.Format ("error BC{0}: {1}", code, text);
RealError (msg);
Check (code);