diff options
author | Martin Odersky <odersky@gmail.com> | 2003-03-21 11:40:21 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-03-21 11:40:21 +0000 |
commit | e6ebbe6ab4550a542db29372e59d72a2ff90e6e3 (patch) | |
tree | c4c155d9217e1b3e1814aeb8e0541f061b67215f /sources/scalac/Global.java | |
parent | 940c7755d3997238492c9e53668fc663aeef2302 (diff) | |
download | scala-e6ebbe6ab4550a542db29372e59d72a2ff90e6e3.tar.gz scala-e6ebbe6ab4550a542db29372e59d72a2ff90e6e3.tar.bz2 scala-e6ebbe6ab4550a542db29372e59d72a2ff90e6e3.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/Global.java')
-rw-r--r-- | sources/scalac/Global.java | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java index 15eb81baf8..c4ecc98a88 100644 --- a/sources/scalac/Global.java +++ b/sources/scalac/Global.java @@ -17,10 +17,7 @@ import scalac.symtab.Definitions; import scalac.ast.printer.*; import scalac.backend.Primitives; // !!! <<< Interpreter stuff -import scalac.symtab.Kinds; -import scalac.symtab.Type; -import scalac.symtab.Symbol; -import scalac.symtab.Scope; +import scalac.symtab.*; // !!! >>> Interpreter stuff @@ -87,6 +84,10 @@ public class Global { public OutputStream printStream; public final TreePrinter debugPrinter; + /** The set of currenttly compiled top-level symbols + */ + public HashSet/*Symbol*/ compiledNow = new HashSet(); + /** the current phase */ public PhaseDescriptor currentPhase; @@ -280,8 +281,13 @@ public class Global { if (currentPhase == PHASE.PARSER) fix1(); if (currentPhase == PHASE.ANALYZER) fix2(); } - if (reporter.errors() != 0) imports.clear(); - + if (reporter.errors() != 0) { + imports.clear(); + for (Iterator it = compiledNow.iterator(); it.hasNext();) { + uninitialize((Symbol)it.next()); + } + } + compiledNow.clear(); printer.end(); } // !!! <<< Interpreter stuff @@ -623,4 +629,14 @@ public class Global { reporter.inform("[" + message + " in " + (System.currentTimeMillis() - start) + "ms]"); } + + private void uninitialize(Symbol sym) { + if (sym instanceof ClassSymbol) { + ClassSymbol clazz = (ClassSymbol)sym; + if (clazz.sourcefile != null) { + clazz.reset( + new SourceCompleter(this, clazz.sourcefile)); + } + } + } } |