summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2004-06-02 19:06:48 +0000
committermihaylov <mihaylov@epfl.ch>2004-06-02 19:06:48 +0000
commite3deada17d62560024239252d4ed24fbbdda58bb (patch)
tree7801228c994cd8f323682d179fc0cdfc2cbd5b21 /sources
parent3f137861e9c46de3218f8132da82e299e9ad35fa (diff)
downloadscala-e3deada17d62560024239252d4ed24fbbdda58bb.tar.gz
scala-e3deada17d62560024239252d4ed24fbbdda58bb.tar.bz2
scala-e3deada17d62560024239252d4ed24fbbdda58bb.zip
- With the MSIL backend initialize CLRPackagePa...
- With the MSIL backend initialize CLRPackageParser before creating Global
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/tools/scalac/Main.scala20
1 files changed, 14 insertions, 6 deletions
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);
}
}
}