summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-26 08:48:26 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-27 15:49:03 +0200
commite9fbb661a3deb6e6234bdf94dce6fa98a205f3ca (patch)
treefba72faa84d814735024081a1cd1644e9c75e9da /src/compiler
parent1839c1b5528e706c280e7d81031499f3d46826ec (diff)
downloadscala-e9fbb661a3deb6e6234bdf94dce6fa98a205f3ca.tar.gz
scala-e9fbb661a3deb6e6234bdf94dce6fa98a205f3ca.tar.bz2
scala-e9fbb661a3deb6e6234bdf94dce6fa98a205f3ca.zip
removes extraneous stuff from macros.Infrastructure
libraryClassLoader can be derived from currentClassPath currentMacro can be trivially derived from macroApplication Backend-detection methods forXXX (as in forJVM or forScaladoc) might be useful, but current design of this API is not future-proof. I'm not able to come up with a better design on the spot, so let's remove this functionality for the moment.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Evals.scala2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Infrastructure.scala14
2 files changed, 2 insertions, 14 deletions
diff --git a/src/compiler/scala/reflect/macros/runtime/Evals.scala b/src/compiler/scala/reflect/macros/runtime/Evals.scala
index acafeb5b02..1f7b5f2ff1 100644
--- a/src/compiler/scala/reflect/macros/runtime/Evals.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Evals.scala
@@ -7,7 +7,7 @@ import scala.tools.reflect.ToolBox
trait Evals {
self: Context =>
- private lazy val evalMirror = ru.runtimeMirror(libraryClassLoader)
+ private lazy val evalMirror = ru.runtimeMirror(universe.analyzer.macroClassloader)
private lazy val evalToolBox = evalMirror.mkToolBox()
private lazy val evalImporter = ru.mkImporter(universe).asInstanceOf[ru.Importer { val from: universe.type }]
diff --git a/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala b/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala
index 7157dbeaa2..87ac97ff27 100644
--- a/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala
@@ -6,19 +6,9 @@ import scala.tools.nsc.util.ScalaClassLoader
trait Infrastructure {
self: Context =>
- val forJVM: Boolean = universe.forJVM
-
- val forMSIL: Boolean = universe.forMSIL
-
- val forInteractive: Boolean = universe.forInteractive
-
- val forScaladoc: Boolean = universe.forScaladoc
-
val currentRun: Run = universe.currentRun
- val libraryClassPath: List[java.net.URL] = universe.classPath.asURLs
-
- lazy val libraryClassLoader: ClassLoader = universe.analyzer.macroClassloader
+ val currentClassPath: List[java.net.URL] = universe.classPath.asURLs
type Run = universe.Run
@@ -31,6 +21,4 @@ trait Infrastructure {
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))
}
-
- val currentMacro: Symbol = expandee.symbol
}