Skip to content

Commit 76ea699

Browse files
oderskyDarkDimius
authored andcommitted
Renaming core.Transformer(s) -> core.DenotTransformer(s)
To bring in line with TreeTransformer terminology.
1 parent 9c7cf4e commit 76ea699

File tree

7 files changed

+17
-18
lines changed

7 files changed

+17
-18
lines changed

src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ object Contexts {
361361
* compiler run.
362362
*/
363363
class ContextBase extends ContextState
364-
with Transformers.TransformerBase
364+
with DenotTransformers.DenotTransformerBase
365365
with Denotations.DenotationsBase
366366
with Phases.PhasesBase {
367367

src/dotty/tools/dotc/core/Transformers.scala renamed to src/dotty/tools/dotc/core/DenotTransformers.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import Denotations._
99
import java.lang.AssertionError
1010
import dotty.tools.dotc.util.DotClass
1111

12-
object Transformers {
12+
object DenotTransformers {
1313

14-
trait TransformerBase { self: ContextBase =>
15-
val infoTransformers = new TransformerGroup
14+
trait DenotTransformerBase { self: ContextBase =>
15+
val denotTransformers = new DenotTransformerGroup
1616
}
1717

1818
/** A transformer group contains a sequence of transformers,
@@ -24,14 +24,14 @@ object Transformers {
2424
* full symbol denotations, refTransformers translate only symbol references
2525
* of type Unique/JointRefDenotation.
2626
*/
27-
class TransformerGroup {
27+
class DenotTransformerGroup {
2828

2929
private val nxTransformer =
30-
Array.fill[Transformer](MaxPossiblePhaseId + 1)(NoTransformer)
30+
Array.fill[DenotTransformer](MaxPossiblePhaseId + 1)(NoTransformer)
3131

3232
def nextTransformer(pid: PhaseId) = nxTransformer(pid)
3333

34-
def install(pid: PhaseId, transFn: TransformerGroup => Transformer): Unit =
34+
def install(pid: PhaseId, transFn: DenotTransformerGroup => DenotTransformer): Unit =
3535
if ((pid > NoPhaseId) && (nxTransformer(pid).phaseId > pid)) {
3636
val trans = transFn(this)
3737
trans._phaseId = pid
@@ -40,7 +40,7 @@ object Transformers {
4040
}
4141

4242
/** A sentinel transformer object */
43-
object NoTransformer extends Transformer(this) {
43+
object NoTransformer extends DenotTransformer(this) {
4444
_phaseId = MaxPossiblePhaseId + 1
4545
override def lastPhaseId = phaseId - 1 // TODO JZ Probably off-by-N error here. MO: Don't think so: we want empty validity period.
4646
def transform(ref: SingleDenotation)(implicit ctx: Context): SingleDenotation =
@@ -49,9 +49,9 @@ object Transformers {
4949
}
5050

5151
/** A transformer transforms denotations at a given phase */
52-
abstract class Transformer(group: TransformerGroup) extends DotClass {
52+
abstract class DenotTransformer(group: DenotTransformerGroup) extends DotClass {
5353

54-
private[Transformers] var _phaseId: PhaseId = _
54+
private[DenotTransformers] var _phaseId: PhaseId = _
5555

5656
/** The phase at the start of which the denotations are transformed */
5757
def phaseId: PhaseId = _phaseId

src/dotty/tools/dotc/core/Denotations.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Symbols._
1111
import Types._
1212
import Periods._
1313
import Flags._
14-
import Transformers._
14+
import DenotTransformers._
1515
import Decorators._
1616
import transform.Erasure
1717
import printing.Texts._
@@ -518,7 +518,7 @@ object Denotations {
518518
} else {
519519
// not found, cur points to highest existing variant
520520
var startPid = cur.validFor.lastPhaseId + 1
521-
val transformer = ctx.infoTransformers.nextTransformer(startPid)
521+
val transformer = ctx.denotTransformers.nextTransformer(startPid)
522522
next = transformer.transform(cur).syncWithParents
523523
if (next eq cur)
524524
startPid = cur.validFor.firstPhaseId

src/dotty/tools/dotc/core/Periods.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class Periods extends DotClass { self: Context =>
3434
*/
3535
def stablePeriod = {
3636
var first = phaseId
37-
val transformers = base.infoTransformers
37+
val transformers = base.denotTransformers
3838
val nxTrans = transformers.nextTransformer(first)
3939
while (first - 1 > NoPhaseId &&
4040
(transformers.nextTransformer(first - 1) eq nxTrans)) {

src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package dotty.tools.dotc
22
package core
33

44
import Periods._, Contexts._, Symbols._, Denotations._, Names._, NameOps._, Annotations._
5-
import Types._, Flags._, Decorators._, Transformers._, StdNames._, Scopes._
5+
import Types._, Flags._, Decorators._, DenotTransformers._, StdNames._, Scopes._
66
import NameOps._
77
import Scopes.Scope
88
import collection.mutable

src/dotty/tools/dotc/core/Symbols.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package dotc
33
package core
44

55
import Periods._
6-
import Transformers._
76
import Names._
87
import Scopes._
98
import Flags._

src/dotty/tools/dotc/transform/SamplePhase.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ package dotty.tools.dotc
22
package transform
33

44
import TreeTransforms._
5+
import core.DenotTransformers._
56
import core.Denotations._
67
import core.Contexts._
78
import ast.Trees._
89
import ast.tpd.{Apply, Tree, cpy}
9-
import core.Transformers._
1010

1111
class SamplePhase extends TreeTransformer {
1212

1313
def init(implicit ctx: Context) = {
14-
ctx.base.infoTransformers.install(id, new UncurryInfoTransform(_))
14+
ctx.base.denotTransformers.install(id, new UncurryDenotTransform(_))
1515
}
1616

1717
def name = "sample"
@@ -20,7 +20,7 @@ class SamplePhase extends TreeTransformer {
2020

2121
}
2222

23-
class UncurryInfoTransform(group: TransformerGroup) extends Transformer(group) {
23+
class UncurryDenotTransform(group: DenotTransformerGroup) extends DenotTransformer(group) {
2424

2525
def transform(ref: SingleDenotation)(implicit ctx: Context): SingleDenotation = ???
2626

0 commit comments

Comments
 (0)