diff options
author | Sean McDirmid <sean.mcdirmid@gmail.com> | 2005-12-07 16:33:48 +0000 |
---|---|---|
committer | Sean McDirmid <sean.mcdirmid@gmail.com> | 2005-12-07 16:33:48 +0000 |
commit | 3d141a01305f45c4ec14e119006218ceb6994c00 (patch) | |
tree | f7eee1de610a9bd116f6875e079cdebcd4d7a910 /sources/scala/tools/nsc/Global.scala | |
parent | 53cfb592699f3eca94a42022781d31bdd64d9d8d (diff) | |
download | scala-3d141a01305f45c4ec14e119006218ceb6994c00.tar.gz scala-3d141a01305f45c4ec14e119006218ceb6994c00.tar.bz2 scala-3d141a01305f45c4ec14e119006218ceb6994c00.zip |
Set source file in ClassSym symbols.
Diffstat (limited to 'sources/scala/tools/nsc/Global.scala')
-rwxr-xr-x | sources/scala/tools/nsc/Global.scala | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sources/scala/tools/nsc/Global.scala b/sources/scala/tools/nsc/Global.scala index dc709117de..d0a35b8aa8 100755 --- a/sources/scala/tools/nsc/Global.scala +++ b/sources/scala/tools/nsc/Global.scala @@ -160,14 +160,19 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable abstract class GlobalPhase(prev: Phase) extends Phase(prev) { phaseWithId(id) = this; def run: unit = currentRun.units foreach applyPhase; + def apply(unit: CompilationUnit): unit; private val isErased = prev.name == "erasure" || prev.erasedTypes; override def erasedTypes: boolean = isErased; private val isFlat = prev.name == "flatten" || prev.flatClasses; override def flatClasses: boolean = isFlat; - def applyPhase(unit: CompilationUnit): unit = { + final def applyPhase(unit: CompilationUnit): unit = { if (settings.debug.value) inform("[running phase " + name + " on " + unit + "]"); - apply(unit) + val unit0 = currentRun.currentUnit; + currentRun.currentUnit = unit; + apply(unit); + assert(currentRun.currentUnit == unit); + currentRun.currentUnit = unit0; } } @@ -278,6 +283,7 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable override val terminalPhase : Phase = typerPhase.next; } class Run extends CompilerRun { + var currentUnit : CompilationUnit = _; curRun = this; override val firstPhase = syntaxAnalyzer.newPhase(NoPhase); phase = firstPhase; @@ -333,7 +339,6 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable def compileSources(sources: List[SourceFile]): unit = { val startTime = System.currentTimeMillis(); reporter.reset; - for (val source <- sources) addUnit(new CompilationUnit(source)); |