aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Phases.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2014-11-03 17:31:55 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-11-03 17:31:55 +0100
commit3c595635d4c19b682e0cd5642d56f3b3352eb4db (patch)
tree35a35ce8ba7f2490689156f6fcbd566279bfe3a9 /src/dotty/tools/dotc/core/Phases.scala
parent09d5673de8d3a9ddd50c3c221992ede6117e16bf (diff)
downloaddotty-3c595635d4c19b682e0cd5642d56f3b3352eb4db.tar.gz
dotty-3c595635d4c19b682e0cd5642d56f3b3352eb4db.tar.bz2
dotty-3c595635d4c19b682e0cd5642d56f3b3352eb4db.zip
Phase.runOn is now List[ComliplationUnit] => List[ComliplationUnit]
Allows to alter number of compilation units.
Diffstat (limited to 'src/dotty/tools/dotc/core/Phases.scala')
-rw-r--r--src/dotty/tools/dotc/core/Phases.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Phases.scala b/src/dotty/tools/dotc/core/Phases.scala
index 476ce6e55..348789e14 100644
--- a/src/dotty/tools/dotc/core/Phases.scala
+++ b/src/dotty/tools/dotc/core/Phases.scala
@@ -192,8 +192,12 @@ object Phases {
def run(implicit ctx: Context): Unit
- def runOn(units: List[CompilationUnit])(implicit ctx: Context): Unit =
- for (unit <- units) run(ctx.fresh.setPhase(this).setCompilationUnit(unit))
+ def runOn(units: List[CompilationUnit])(implicit ctx: Context): List[CompilationUnit] =
+ units.map { unit =>
+ val unitCtx = ctx.fresh.setPhase(this).setCompilationUnit(unit)
+ run(unitCtx)
+ unitCtx.compilationUnit
+ }
def description: String = phaseName