summaryrefslogtreecommitdiff
path: root/test/files/run/macroPlugins-typedMacroBody
Commit message (Collapse)AuthorAgeFilesLines
* *boxContext => *box.Context , *boxMacro => *box.MacroEugene Burmako2014-01-121-3/+3
| | | | | | | | | | Performs the following renamings: * scala.reflect.macros.BlackboxContext to scala.reflect.macros.blackbox.Context * scala.reflect.macros.BlackboxMacro to scala.reflect.macros.blackbox.Macro * scala.reflect.macros.WhiteboxContext to scala.reflect.macros.whitebox.Context * scala.reflect.macros.WhiteboxMacro to scala.reflect.macros.whitebox.Macro https://groups.google.com/forum/#!topic/scala-internals/MX40-dM28rk
* hooks for naming and synthesis in Namers.scala and Typers.scalaEugene Burmako2013-12-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Interestingly enough, despite of the implementation surface being quite noticeable, it is enough to hijack just `enterSym` and typechecking of stats for packages, templates and blocks in order to enable macro annotations. That and `ensureCompanionObject`, which I couldn't abstract away so far. An architectural note: given that a hooked method is called `X`, there are two implementations of this method. `pluginsX` is defined in AnalyzerPlugins.scala and lets macro plugins customize `X`. `standardX` is defined next to `X` and provides a default implementation. Finally `X` is changed to trivially forward to `pluginsX`. Existing and future callers of `X` now can be completely oblivious of the introduced hooks, because calls to `X` will continue working and will be correctly hooked. This makes the infrastructure more robust. The only downside is that in case when a macro plugin wants to call into the default implementation, it needs to call `standardX`, because `X` will lead to a stack overflow. However, in my opinion this not a big problem, because such failures are load and clear + for every `pluginsX` we actually provide documentation that says what is its standard impl is.
* unprivates important helpers in Namers.scalaEugene Burmako2013-12-305-0/+48
This is the first of two commits that enable hooks necessary to implement macro annotations in an honest, hackless compiler plugin. This particular commit turns certain helpers into public methods. Of course, there is a probability that with the evolution of macro paradise, I will need more helper methods, and those will have to be called via reflection, but at least for now it's nice to have a reflection-less plugin :)