diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-06-06 14:29:05 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-06-08 15:31:58 +0200 |
commit | ce67870e64afabf75363679bcee597812ad223e9 (patch) | |
tree | ce84ef7673977b0dde4ed13ca1276e25517d6b9c /src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala | |
parent | bdff66e2730518f449634375b1f3d19689d72b1e (diff) | |
download | scala-ce67870e64afabf75363679bcee597812ad223e9.tar.gz scala-ce67870e64afabf75363679bcee597812ad223e9.tar.bz2 scala-ce67870e64afabf75363679bcee597812ad223e9.zip |
brings macros up to speed
Before reflection refactoring, macro contexts only exposed a mirror.
Now it's time to expose both a universe (the compiler instance) and
a mirror (a macro-specific symbol resolver).
By the way, speaking of mirrors. Macro contexts have their own mirror,
which is different from compiler's rootMirror. This is done because
macros need to be able to resolve stuff from empty package.
Reflection refactoring brought major changes to runtime evaluation,
which got dropped from universes and now requires scala-compiler.jar.
However there are macro users, who would like to do eval inside macros.
To help them we expose `libraryClassLoader` to manually build toolboxes,
and also a simple-to-use `c.eval` method.
I've also sneakily introduced `c.parse`, because it's something that
has also been frequently requested. Moreover, it might help Scaladoc.
So I decided that it might be worth it to add this new functionality.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala b/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala index 3033230603..190b18711c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala +++ b/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala @@ -5,6 +5,6 @@ trait StdAttachments { self: Analyzer => type UnaffiliatedMacroContext = scala.reflect.makro.runtime.Context - type MacroContext = UnaffiliatedMacroContext { val mirror: self.global.type } - case class MacroAttachment(delayed: Boolean, typerContext: Context, macroContext: Option[MacroContext]) + type MacroContext = UnaffiliatedMacroContext { val universe: self.global.type } + case class MacroRuntimeAttachment(delayed: Boolean, typerContext: Context, macroContext: Option[MacroContext]) }
\ No newline at end of file |