Skip to content

Commit 58e902b

Browse files
committed
Rename quotation -> transformQuotation and splice -> transformSplice
1 parent 14e2155 commit 58e902b

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ class ReifyQuotes extends MacroTransform {
168168
* `scala.quoted.Unpickler.unpickleExpr` that matches `tpe` with
169169
* core and splices as arguments.
170170
*/
171-
override protected def quotation(body: Tree, quote: Tree)(implicit ctx: Context): Tree = {
171+
override protected def transformQuotation(body: Tree, quote: Tree)(implicit ctx: Context): Tree = {
172172
val isType = quote.symbol eq defn.QuotedType_apply
173173
assert(!body.symbol.isSplice)
174174
if (level > 0) {
175175
val body1 = nested(isQuote = true).transform(body)(quoteContext)
176-
super.quotation(body1, quote)
176+
super.transformQuotation(body1, quote)
177177
}
178178
else body match {
179179
case body: RefTree if isCaptured(body.symbol, level + 1) =>
@@ -230,7 +230,7 @@ class ReifyQuotes extends MacroTransform {
230230
* and make a hole from these parts. Otherwise issue an error, unless we
231231
* are in the body of an inline method.
232232
*/
233-
protected def splice(splice: Select)(implicit ctx: Context): Tree = {
233+
protected def transformSplice(splice: Select)(implicit ctx: Context): Tree = {
234234
if (level > 1) {
235235
val body1 = nested(isQuote = false).transform(splice.qualifier)(spliceContext)
236236
body1.select(splice.name)
@@ -357,15 +357,15 @@ class ReifyQuotes extends MacroTransform {
357357
case TypeApply(Select(spliceTree @ Spliced(_), _), tp) if tree.symbol == defn.Any_asInstanceOf =>
358358
// Splice term which should be in the form `x.unary_~.asInstanceOf[T]` where T is an artefact of
359359
// typer to allow pickling/unpickling phase consistent types
360-
splice(spliceTree)
360+
transformSplice(spliceTree)
361361

362362
case tree: TypeTree if tree.tpe.typeSymbol.isSplice =>
363363
val splicedType = tree.tpe.stripTypeVar.asInstanceOf[TypeRef].prefix.termSymbol
364-
splice(ref(splicedType).select(tpnme.UNARY_~).withSpan(tree.span))
364+
transformSplice(ref(splicedType).select(tpnme.UNARY_~).withSpan(tree.span))
365365

366366
case tree: RefTree if isCaptured(tree.symbol, level) =>
367367
val t = capturers(tree.symbol).apply(tree)
368-
splice(t.select(if (tree.isTerm) nme.UNARY_~ else tpnme.UNARY_~))
368+
transformSplice(t.select(if (tree.isTerm) nme.UNARY_~ else tpnme.UNARY_~))
369369

370370
case tree: DefDef if tree.symbol.is(Macro) && level == 0 =>
371371
// Shrink size of the tree. The methods have already been inlined.

compiler/src/dotty/tools/dotc/transform/Staging.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,17 @@ class Staging extends MacroTransform {
124124
}
125125

126126
/** Transform quoted trees while maintaining phase correctness */
127-
override protected def quotation(body: Tree, quote: Tree)(implicit ctx: Context): Tree = {
127+
override protected def transformQuotation(body: Tree, quote: Tree)(implicit ctx: Context): Tree = {
128128
val body1 = transform(body)(quoteContext)
129-
super.quotation(body1, quote)
129+
super.transformQuotation(body1, quote)
130130
}
131131

132132
/** Transform splice
133133
* - If inside a quote, transform the contents of the splice.
134134
* - If inside inlined code, expand the macro code.
135135
* - If inside of a macro definition, check the validity of the macro.
136136
*/
137-
protected def splice(splice: Select)(implicit ctx: Context): Tree = {
137+
protected def transformSplice(splice: Select)(implicit ctx: Context): Tree = {
138138
if (level >= 1) {
139139
val body1 = transform(splice.qualifier)(spliceContext)
140140
val splice1 = cpy.Select(splice)(body1, splice.name)

compiler/src/dotty/tools/dotc/transform/TreeMapWithStages.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ abstract class TreeMapWithStages(@constructorOnly ictx: Context) extends TreeMap
5656
}
5757

5858
/** Transform the quote `quote` which contains the quoted `body`. */
59-
protected def quotation(body: Tree, quote: Tree)(implicit ctx: Context): Tree = {
59+
protected def transformQuotation(body: Tree, quote: Tree)(implicit ctx: Context): Tree = {
6060
quote match {
6161
case quote: Apply => cpy.Apply(quote)(quote.fun, body :: Nil)
6262
case quote: TypeApply => cpy.TypeApply(quote)(quote.fun, body :: Nil)
6363
}
6464
}
6565

6666
/** Transform the splice `splice`. */
67-
protected def splice(splice: Select)(implicit ctx: Context): Tree
67+
protected def transformSplice(splice: Select)(implicit ctx: Context): Tree
6868

6969
override def transform(tree: Tree)(implicit ctx: Context): Tree = {
7070
reporting.trace(i"StagingTransformer.transform $tree at $level", show = true) {
@@ -81,13 +81,13 @@ abstract class TreeMapWithStages(@constructorOnly ictx: Context) extends TreeMap
8181
transform(t) // '(~x) --> x
8282

8383
case Quoted(quotedTree) =>
84-
quotation(quotedTree, tree)
84+
transformQuotation(quotedTree, tree)
8585

8686
case Spliced(Quoted(quotedTree)) =>
8787
transform(quotedTree) // ~('x) --> x
8888

8989
case tree @ Spliced(_) =>
90-
splice(tree)
90+
transformSplice(tree)
9191

9292
case Block(stats, _) =>
9393
val last = enteredSyms

0 commit comments

Comments
 (0)