diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-09-26 09:09:34 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-09-27 15:53:15 +0200 |
commit | e74c432fdbce2b3eaaddcba8c733cf7ccc0ee2ed (patch) | |
tree | 60d6f731754304ea8a23ea49d076dd7128449df2 /src/compiler | |
parent | 94e280dee6655f9d4242ab5fd1f46c97975c7182 (diff) | |
download | scala-e74c432fdbce2b3eaaddcba8c733cf7ccc0ee2ed.tar.gz scala-e74c432fdbce2b3eaaddcba8c733cf7ccc0ee2ed.tar.bz2 scala-e74c432fdbce2b3eaaddcba8c733cf7ccc0ee2ed.zip |
simplifies Context.Run and Context.CompilationUnit
By turning them from abstract types into full-fledged traits
implemented by our internal Run and CompilationUnit.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/reflect/macros/runtime/Infrastructure.scala | 11 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/CompilationUnits.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 2 |
3 files changed, 2 insertions, 13 deletions
diff --git a/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala b/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala index 87ac97ff27..3a1df5f7ce 100644 --- a/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala +++ b/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala @@ -10,15 +10,4 @@ trait Infrastructure { val currentClassPath: List[java.net.URL] = universe.classPath.asURLs - type Run = universe.Run - - object Run extends RunExtractor { - def unapply(run: Run): Option[(CompilationUnit, List[CompilationUnit])] = Some((run.currentUnit, run.units.toList)) - } - - type CompilationUnit = universe.CompilationUnit - - object CompilationUnit extends CompilationUnitExtractor { - def unapply(compilationUnit: CompilationUnit): Option[(java.io.File, Array[Char], Tree)] = Some((compilationUnit.source.file.file, compilationUnit.source.content, compilationUnit.body)) - } } diff --git a/src/compiler/scala/tools/nsc/CompilationUnits.scala b/src/compiler/scala/tools/nsc/CompilationUnits.scala index 6d3fd2e09e..5a2d5ef165 100644 --- a/src/compiler/scala/tools/nsc/CompilationUnits.scala +++ b/src/compiler/scala/tools/nsc/CompilationUnits.scala @@ -23,7 +23,7 @@ trait CompilationUnits { self: Global => /** One unit of compilation that has been submitted to the compiler. * It typically corresponds to a single file of source code. It includes * error-reporting hooks. */ - class CompilationUnit(val source: SourceFile) { + class CompilationUnit(val source: SourceFile) extends CompilationUnitContextApi { /** the fresh name creator */ var fresh: FreshNameCreator = new FreshNameCreator.Default diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 0fbd930ad7..708824ede1 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -1204,7 +1204,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) /** A Run is a single execution of the compiler on a sets of units */ - class Run { + class Run extends RunContextApi { /** Have been running into too many init order issues with Run * during erroneous conditions. Moved all these vals up to the * top of the file so at least they're not trivially null. |