From 401d2012f4c99b170dec99c1f7c4251dda0b20fd Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 12 Aug 2013 18:10:23 +0200 Subject: Refactored handling of phases to make them more robust and simpler to install. --- src/dotty/tools/dotc/core/Contexts.scala | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/dotty/tools/dotc/core/Contexts.scala') diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index ee67ec76e..a193da372 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -373,8 +373,8 @@ object Contexts { /** The loader that loads the members of _root_ */ def rootLoader(root: TermSymbol)(implicit ctx: Context): SymbolLoader = platform.rootLoader(root) - NoPhase // initialize some phases - SomePhase // TODO: Is there a cleaner way to do this? + // Set up some phases to get started */ + usePhases(SomePhase :: Nil) /** The standard definitions */ val definitions = new Definitions()(initialCtx) @@ -434,10 +434,7 @@ object Contexts { // Phases state /** Phases by id */ - private[core] var phases = new Array[Phase](MaxPossiblePhaseId + 1) - - /** The number of defined phases. This includes NoPhase, so nphases >= 1 */ - private[core] var nphases = 0 + private[core] var phases: Array[Phase] = _ // Printers state /** Number of recursive invocations of a show method on cuyrrent stack */ -- cgit v1.2.3