public static int Main (string[] args)
{
Location.InEmacs = Environment.GetEnvironmentVariable ("EMACS") == "t";
CommandLineParser cmd = new CommandLineParser (Console.Out);
var settings = cmd.ParseArguments (args);
if (settings == null)
return 1;
if (cmd.HasBeenStopped)
return 0;
Driver d = new Driver (new CompilerContext (settings, new ConsoleReportPrinter ()));
if (d.Compile () && d.Report.Errors == 0) {
if (d.Report.Warnings > 0) {
Console.WriteLine ("Compilation succeeded - {0} warning(s)", d.Report.Warnings);
}
Environment.Exit (0);
return 0;
}
Console.WriteLine("Compilation failed: {0} error(s), {1} warnings",
d.Report.Errors, d.Report.Warnings);
Environment.Exit (1);
return 1;
}