summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-12-07 14:13:58 +0100
committerEugene Burmako <xeno.by@gmail.com>2013-12-30 19:07:04 +0300
commit68b8e23585b5bbf7ff40d585634a7f07680c278b (patch)
tree0f37b8119f14471ede754768ba62db60c08c4869 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent279e2e3b500c63b867d6f2c26a99aa44babfb8e4 (diff)
downloadscala-68b8e23585b5bbf7ff40d585634a7f07680c278b.tar.gz
scala-68b8e23585b5bbf7ff40d585634a7f07680c278b.tar.bz2
scala-68b8e23585b5bbf7ff40d585634a7f07680c278b.zip
hooks for typecheck and expansion of macro defs
Creates MacroPlugin, a sister interface of AnalyzerPlugin in the namer/typer extensibility interface. Exposes `pluginsTypedMacroBody`, `pluginsMacroExpand`, `pluginsMacroArgs` and `pluginsMacroRuntime` in the macro plugin interface. This will make it easy to prototype changes to the macro engine without disturbing scala/scala.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index f80ebbd7d0..5c1026394a 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1112,7 +1112,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
if (tree.isType)
adaptType()
else if (mode.typingExprNotFun && treeInfo.isMacroApplication(tree) && !isMacroExpansionSuppressed(tree))
- macroExpand(this, tree, mode, pt)
+ pluginsMacroExpand(this, tree, mode, pt)
else if (mode.typingConstructorPattern)
typedConstructorPattern(tree, pt)
else if (shouldInsertApply(tree))
@@ -2209,7 +2209,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
} else if (meth.isMacro) {
// typechecking macro bodies is sort of unconventional
// that's why we employ our custom typing scheme orchestrated outside of the typer
- transformedOr(ddef.rhs, typedMacroBody(this, ddef))
+ transformedOr(ddef.rhs, pluginsTypedMacroBody(this, ddef))
} else {
transformedOrTyped(ddef.rhs, EXPRmode, tpt1.tpe)
}
@@ -5511,7 +5511,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
// here we guard against this case
transformed(ddef.rhs)
} else {
- val rhs1 = typedMacroBody(this, ddef)
+ val rhs1 = pluginsTypedMacroBody(this, ddef)
transformed(ddef.rhs) = rhs1
rhs1
}