message.
* Report.cs: Print error messages properly. Add an extra \n after
the assemble file message.
* ilasm.exe.sources: Add new exception, remove old one.
svn path=/trunk/mcs/; revision=29240
+2004-06-10 Jackson Harper <jackson@ximian.com>
+
+ * Driver.cs: Handle tokenization errors with the correct error
+ message.
+ * Report.cs: Print error messages properly. Add an extra \n after
+ the assemble file message.
+ * ilasm.exe.sources: Add new exception, remove old one.
+
2004-06-04 Jackson Harper <jackson@ximian.com>
* Driver.cs: Do everything using the invariant culture.
DriverMain driver = new DriverMain (args);
try {
- driver.Run ();
+ if (!driver.Run ()) {
+ Console.WriteLine ();
+ Console.WriteLine ("***** FAILURE *****");
+ return 1;
+ }
} catch (Exception e) {
Console.WriteLine (e);
Console.WriteLine ("Error while compiling.");
report = new Report (quiet);
}
- public void Run ()
+ public bool Run ()
{
try {
if (il_file_list.Count == 0)
foreach (string file_path in il_file_list)
ProcessFile (file_path);
if (scan_only)
- return;
+ return true;
+ if (report.ErrorCount > 0)
+ return false;
codegen.Write ();
} catch {
- throw;
+ return false;
}
+
+ return true;
}
private void ProcessFile (string file_path)
new yydebug.yyDebugSimple ());
else
parser.yyparse (new ScannerAdapter (scanner), null);
+ } catch (ILTokenizingException ilte) {
+ report.Error (file_path + "(" + ilte.Location.line + ") : error : " +
+ "syntax error at token '" + ilte.Token + "'.");
} catch {
Console.WriteLine ("Error at: " + scanner.Reader.Location);
throw;
Console.WriteLine ("Assembling '{0}' , {1}, to {2} --> '{3}'", file,
GetListing (listing), target, output);
+ Console.WriteLine ();
}
public void Error (string message)
{
error_count++;
- Console.WriteLine ("Error: " + message);
+ Console.WriteLine (message);
}
private string GetListing (string listing)
codegen/Sentinel.cs
parser/ScannerAdapter.cs
scanner/ILReader.cs
-scanner/ILSyntaxError.cs
+scanner/ILTokenizingException.cs
scanner/ILTables.cs
scanner/ILToken.cs
scanner/ILTokenizer.cs