diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-01-08 11:17:08 -0800 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-01-08 11:17:08 -0800 |
commit | 4e4c15177b92ef25f098277dcce3f874c24640b2 (patch) | |
tree | f46a594ffb47c53cde502d3e172dd4b1c6c2e109 /src/compiler/scala/reflect/macros | |
parent | ada8d9156baad2d8a24c1a40e032eb4bc7154bac (diff) | |
parent | 87913661e199e3894190b7b8aa0900d7237feec0 (diff) | |
download | scala-4e4c15177b92ef25f098277dcce3f874c24640b2.tar.gz scala-4e4c15177b92ef25f098277dcce3f874c24640b2.tar.bz2 scala-4e4c15177b92ef25f098277dcce3f874c24640b2.zip |
Merge pull request #3235 from xeno-by/topic/macro-plugin-interface
new hooks in AnalyzerPlugins to enable macro experimentation
Diffstat (limited to 'src/compiler/scala/reflect/macros')
-rw-r--r-- | src/compiler/scala/reflect/macros/runtime/MacroRuntimes.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/reflect/macros/runtime/MacroRuntimes.scala b/src/compiler/scala/reflect/macros/runtime/MacroRuntimes.scala index 7de3341304..14b0c6baba 100644 --- a/src/compiler/scala/reflect/macros/runtime/MacroRuntimes.scala +++ b/src/compiler/scala/reflect/macros/runtime/MacroRuntimes.scala @@ -19,8 +19,14 @@ trait MacroRuntimes extends JavaReflectionRuntimes with ScalaReflectionRuntimes * @return Requested runtime if macro implementation can be loaded successfully from either of the mirrors, * `null` otherwise. */ + def macroRuntime(expandee: Tree): MacroRuntime = pluginsMacroRuntime(expandee) + + /** Default implementation of `macroRuntime`. + * Can be overridden by analyzer plugins (see AnalyzerPlugins.pluginsMacroRuntime for more details) + */ private val macroRuntimesCache = perRunCaches.newWeakMap[Symbol, MacroRuntime] - def macroRuntime(macroDef: Symbol): MacroRuntime = { + def standardMacroRuntime(expandee: Tree): MacroRuntime = { + val macroDef = expandee.symbol macroLogVerbose(s"looking for macro implementation: $macroDef") if (fastTrack contains macroDef) { macroLogVerbose("macro expansion is serviced by a fast track") |