From e3deada17d62560024239252d4ed24fbbdda58bb Mon Sep 17 00:00:00 2001 From: mihaylov Date: Wed, 2 Jun 2004 19:06:48 +0000 Subject: - With the MSIL backend initialize CLRPackagePa... - With the MSIL backend initialize CLRPackageParser before creating Global --- sources/scala/tools/scalac/Main.scala | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'sources') diff --git a/sources/scala/tools/scalac/Main.scala b/sources/scala/tools/scalac/Main.scala index a7b69c369e..8b637c408e 100644 --- a/sources/scala/tools/scalac/Main.scala +++ b/sources/scala/tools/scalac/Main.scala @@ -7,7 +7,8 @@ \* */ import scalac.util.Reporter; -import scalac.CompilerCommand; +import scalac.{CompilerCommand, Global => scalac_Global}; +import scalac.symtab.classfile.CLRPackageParser; package scala.tools.scalac { @@ -30,14 +31,21 @@ object Main { val reporter = new Reporter(); val command = new CompilerCommand( PRODUCT, VERSION, reporter, new CompilerPhases()); + var ok = true; if (command.parse(args) && command.files.list.size() > 0) { - val global = new Global(command); - global.compile(command.files.toArray(), false); - global.stop("total"); - global.reporter.printSummary(); + if (command.target.value == scalac_Global.TARGET_MSIL) { + try { CLRPackageParser.init(command); } + catch { case e: Error => ok = false; } + } + if (ok) { + val global = new Global(command); + global.compile(command.files.toArray(), false); + global.stop("total"); + global.reporter.printSummary(); + } } if( exitOnError ) { - System.exit(if (reporter.errors() > 0) 1 else 0); + System.exit(if (reporter.errors() > 0 || !ok) 1 else 0); } } } -- cgit v1.2.3