summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/SubComponent.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-07-25 17:35:36 -0700
committerSom Snytt <som.snytt@gmail.com>2013-08-21 17:03:03 -0700
commit591221017b20913bfafde55f7ff8672730bdac82 (patch)
treed5c273b89a5f2c29f8bc1b24536d6155104850fa /src/compiler/scala/tools/nsc/SubComponent.scala
parent26ad989f49640693c78e7af42abae3d75cf36f68 (diff)
downloadscala-591221017b20913bfafde55f7ff8672730bdac82.tar.gz
scala-591221017b20913bfafde55f7ff8672730bdac82.tar.bz2
scala-591221017b20913bfafde55f7ff8672730bdac82.zip
SI-7622 Phases are enabled or not
Refactor the calculation of the "phase chain" a bit. In particular, initial and terminal phases are not special except that they must be head and last. When done, filter for enabled phases. At this commit, nobody claims to be disabled. Additional sanity support of phases settings.
Diffstat (limited to 'src/compiler/scala/tools/nsc/SubComponent.scala')
-rw-r--r--src/compiler/scala/tools/nsc/SubComponent.scala21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/SubComponent.scala b/src/compiler/scala/tools/nsc/SubComponent.scala
index 9b8582ae02..b21d156145 100644
--- a/src/compiler/scala/tools/nsc/SubComponent.scala
+++ b/src/compiler/scala/tools/nsc/SubComponent.scala
@@ -19,19 +19,30 @@ abstract class SubComponent {
/** The name of the phase */
val phaseName: String
- /** List of phase names, this phase should run after */
+ /** Names of phases that must run before this phase. */
val runsAfter: List[String]
- /** List of phase names, this phase should run before */
+ /** Names of phases that must run after this phase. Default is `Nil`. */
val runsBefore: List[String] = Nil
- /** Phase name this phase will attach itself to, not allowing any phase to come between it
- * and the phase name declared */
+ /** Name of the phase that this phase must follow immediately. */
val runsRightAfter: Option[String]
- /** Internal flag to tell external from internal phases */
+ /** Names of phases required by this component. Default is `Nil`. */
+ val requires: List[String] = Nil
+
+ /** Is this component enabled? Default is true. */
+ def enabled: Boolean = true
+
+ /** True if this phase is not provided by a plug-in. */
val internal: Boolean = true
+ /** True if this phase runs before all other phases. Usually, `parser`. */
+ val initial: Boolean = false
+
+ /** True if this phase runs after all other phases. Usually, `terminal`. */
+ val terminal: Boolean = false
+
/** SubComponent are added to a HashSet and two phases are the same if they have the same name */
override def hashCode() = phaseName.hashCode()