summaryrefslogtreecommitdiff
path: root/sources/scala/tools/nsc/Global.scala
diff options
context:
space:
mode:
authorSean McDirmid <sean.mcdirmid@gmail.com>2005-12-09 19:10:43 +0000
committerSean McDirmid <sean.mcdirmid@gmail.com>2005-12-09 19:10:43 +0000
commita88a30cdbc21849998dbf48be3ac6910b6bef6d0 (patch)
tree6290b9db8c2d073a874208093a05ecc528df2a27 /sources/scala/tools/nsc/Global.scala
parentd1ad2bf52182508a532b2a579762be333eae8fb0 (diff)
downloadscala-a88a30cdbc21849998dbf48be3ac6910b6bef6d0.tar.gz
scala-a88a30cdbc21849998dbf48be3ac6910b6bef6d0.tar.bz2
scala-a88a30cdbc21849998dbf48be3ac6910b6bef6d0.zip
Fixed some position bugs.
Diffstat (limited to 'sources/scala/tools/nsc/Global.scala')
-rwxr-xr-xsources/scala/tools/nsc/Global.scala29
1 files changed, 27 insertions, 2 deletions
diff --git a/sources/scala/tools/nsc/Global.scala b/sources/scala/tools/nsc/Global.scala
index 9219646bca..9fee761272 100755
--- a/sources/scala/tools/nsc/Global.scala
+++ b/sources/scala/tools/nsc/Global.scala
@@ -171,6 +171,7 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
val unit0 = currentRun.currentUnit;
currentRun.currentUnit = unit;
apply(unit);
+ currentRun.advanceUnit;
assert(currentRun.currentUnit == unit);
currentRun.currentUnit = unit0;
}
@@ -280,8 +281,12 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
override def currentRun: Run = curRun;
class TyperRun extends Run {
- override val terminalPhase : Phase = typerPhase.next;
+ override val terminalPhase : Phase = typerPhase.next.next;
+ //override val terminalPhase : Phase = superAccessors.next;
}
+
+
+
class Run extends CompilerRun {
var currentUnit : CompilationUnit = _;
curRun = this;
@@ -299,11 +304,29 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
}
}
+ // progress tracking
+ def progress(current : Int, total : Int) : Unit = {}
+ private var phasec : Int = 0;
+ private var unitc : Int = 0;
+ def advancePhase : Unit = {
+ unitc = 0;
+ phasec = phasec + 1;
+ refreshProgress;
+ }
+ def advanceUnit : Unit = {
+ unitc = unitc + 1;
+ refreshProgress;
+ }
+ private def refreshProgress = if (fileset.size > 0)
+ progress((phasec * fileset.size) + unitc,
+ (phaseDescriptors.length+1) * fileset.size);
+
+
+
override val terminalPhase : Phase = new GlobalPhase(p) {
def name = "terminal";
def apply(unit: CompilationUnit): unit = {}
}
-
override def phaseNamed(name: String): Phase = {
var p: Phase = firstPhase;
while (p.next != p && p.name != name) p = p.next;
@@ -357,6 +380,7 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
else checker.checkTrees;
}
if (settings.statistics.value) statistics.print(phase);
+ advancePhase;
}
if (settings.Xshowcls.value != "") showDef(newTermName(settings.Xshowcls.value), false);
@@ -399,6 +423,7 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
atPhase(localPhase)(localPhase.applyPhase(unit));
localPhase = localPhase.next.asInstanceOf[GlobalPhase];
}
+ refreshProgress;
}
def compileFiles(files: List[AbstractFile]): unit =