diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-28 22:35:15 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-04-11 09:33:11 +0200 |
commit | 3fe4e061ef90b8dde10b2e9542f17a34c0fbcb5d (patch) | |
tree | 2780821f32afabb8fac92cd9a38ad462b69191b5 /compiler/src/dotty/tools/dotc/core/Names.scala | |
parent | ca5652cc5a74f00277ce942a001fa6e931ee3728 (diff) | |
download | dotty-3fe4e061ef90b8dde10b2e9542f17a34c0fbcb5d.tar.gz dotty-3fe4e061ef90b8dde10b2e9542f17a34c0fbcb5d.tar.bz2 dotty-3fe4e061ef90b8dde10b2e9542f17a34c0fbcb5d.zip |
Rename NameExtractor -> NameKind
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Names.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Names.scala | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Names.scala b/compiler/src/dotty/tools/dotc/core/Names.scala index e4ebe61c2..37df9cd24 100644 --- a/compiler/src/dotty/tools/dotc/core/Names.scala +++ b/compiler/src/dotty/tools/dotc/core/Names.scala @@ -19,7 +19,7 @@ import java.util.HashMap //import annotation.volatile object Names { - import NameExtractors._ + import NameKinds._ /** A common class for things that can be turned into names. * Instances are both names and strings, the latter via a decorator. @@ -75,9 +75,9 @@ object Names { def likeKinded(name: Name): ThisName def derived(info: NameInfo): ThisName - def derived(kind: ClassifiedNameExtractor): ThisName = derived(kind.info) - def exclude(kind: NameExtractor): ThisName - def is(kind: NameExtractor): Boolean + def derived(kind: ClassifiedNameKind): ThisName = derived(kind.info) + def exclude(kind: NameKind): ThisName + def is(kind: NameKind): Boolean def debugString: String def toText(printer: Printer): Text = printer.toText(this) @@ -130,7 +130,7 @@ object Names { def likeKinded(name: Name): TermName = name.toTermName - def info: NameInfo = SimpleTermNameExtractor.info + def info: NameInfo = SimpleTermNameKind.info def underlying: TermName = unsupported("underlying") @sharable private var derivedNames: AnyRef /* SimpleMap | j.u.HashMap */ = @@ -174,8 +174,8 @@ object Names { * name as underlying name. */ def derived(info: NameInfo): TermName = { - val thisKind = this.info.extractor - val thatKind = info.extractor + val thisKind = this.info.kind + val thatKind = info.kind if (thisKind.tag < thatKind.tag || thatKind.definesNewName) add(info) else if (thisKind.tag > thatKind.tag) rewrap(underlying.derived(info)) else { @@ -184,15 +184,15 @@ object Names { } } - def exclude(kind: NameExtractor): TermName = { - val thisKind = this.info.extractor + def exclude(kind: NameKind): TermName = { + val thisKind = this.info.kind if (thisKind.tag < kind.tag || thisKind.definesNewName) this else if (thisKind.tag > kind.tag) rewrap(underlying.exclude(kind)) else underlying } - def is(kind: NameExtractor): Boolean = { - val thisKind = this.info.extractor + def is(kind: NameKind): Boolean = { + val thisKind = this.info.kind thisKind == kind || !thisKind.definesNewName && thisKind.tag > kind.tag && underlying.is(kind) } @@ -295,8 +295,8 @@ object Names { def likeKinded(name: Name): TypeName = name.toTypeName def derived(info: NameInfo): TypeName = toTermName.derived(info).toTypeName - def exclude(kind: NameExtractor): TypeName = toTermName.exclude(kind).toTypeName - def is(kind: NameExtractor) = toTermName.is(kind) + def exclude(kind: NameKind): TypeName = toTermName.exclude(kind).toTypeName + def is(kind: NameKind) = toTermName.is(kind) override def toString = toTermName.toString override def debugString = toTermName.debugString + "/T" @@ -512,7 +512,7 @@ object Names { implicit val NameOrdering: Ordering[Name] = new Ordering[Name] { private def compareInfos(x: NameInfo, y: NameInfo): Int = - if (x.extractor.tag != y.extractor.tag) x.extractor.tag - y.extractor.tag + if (x.kind.tag != y.kind.tag) x.kind.tag - y.kind.tag else x match { case x: QualifiedInfo => y match { |