summaryrefslogtreecommitdiff
path: root/sources/scala/tools/nsc/Global.scala
diff options
context:
space:
mode:
authorSean McDirmid <sean.mcdirmid@gmail.com>2005-12-02 15:34:31 +0000
committerSean McDirmid <sean.mcdirmid@gmail.com>2005-12-02 15:34:31 +0000
commitd4a7e14e41a918cd6de0a5efc1002c9d87fb7708 (patch)
treed284894da803392db21b910ab1518c5be2153976 /sources/scala/tools/nsc/Global.scala
parent4720d45a832b3a8c818ae81cb0a15353fd16e372 (diff)
downloadscala-d4a7e14e41a918cd6de0a5efc1002c9d87fb7708.tar.gz
scala-d4a7e14e41a918cd6de0a5efc1002c9d87fb7708.tar.bz2
scala-d4a7e14e41a918cd6de0a5efc1002c9d87fb7708.zip
Revamped reporter classes to make them more fri...
Revamped reporter classes to make them more friendly with the plugin.
Diffstat (limited to 'sources/scala/tools/nsc/Global.scala')
-rwxr-xr-xsources/scala/tools/nsc/Global.scala13
1 files changed, 9 insertions, 4 deletions
diff --git a/sources/scala/tools/nsc/Global.scala b/sources/scala/tools/nsc/Global.scala
index e6d2747d4b..8be805b45b 100755
--- a/sources/scala/tools/nsc/Global.scala
+++ b/sources/scala/tools/nsc/Global.scala
@@ -274,6 +274,9 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
private var curRun: Run = NoRun;
override def currentRun: Run = curRun;
+ class TyperRun extends Run {
+ override val terminalPhase : Phase = typerPhase.next;
+ }
class Run extends CompilerRun {
curRun = this;
override val firstPhase = syntaxAnalyzer.newPhase(NoPhase);
@@ -290,7 +293,7 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
}
}
- override val terminalPhase = new GlobalPhase(p) {
+ override val terminalPhase : Phase = new GlobalPhase(p) {
def name = "terminal";
def apply(unit: CompilationUnit): unit = {}
}
@@ -325,15 +328,17 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
/** A map from compiled top-level symbols to their picklers */
val symData = new HashMap[Symbol, PickleBuffer];
+
+
def compileSources(sources: List[SourceFile]): unit = {
val startTime = System.currentTimeMillis();
- reporter.resetCounters();
+ reporter.reset;
for (val source <- sources)
addUnit(new CompilationUnit(source));
globalPhase = firstPhase;
- while (globalPhase != terminalPhase && reporter.errors() == 0) {
+ while (globalPhase != terminalPhase && reporter.errors == 0) {
val startTime = System.currentTimeMillis();
phase = globalPhase;
globalPhase.run;
@@ -353,7 +358,7 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
if (settings.Xshowobj.value != "") showDef(newTermName(settings.Xshowobj.value), true);
if (settings.Xshowicode.value) writeICode();
- if (reporter.errors() == 0) {
+ if (reporter.errors == 0) {
for (val Pair(sym, pickled) <- symData.elements.toList) {
sym setPos Position.NOPOS;
if (symData contains sym) {