aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-28 22:35:15 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 09:33:11 +0200
commit3fe4e061ef90b8dde10b2e9542f17a34c0fbcb5d (patch)
tree2780821f32afabb8fac92cd9a38ad462b69191b5
parentca5652cc5a74f00277ce942a001fa6e931ee3728 (diff)
downloaddotty-3fe4e061ef90b8dde10b2e9542f17a34c0fbcb5d.tar.gz
dotty-3fe4e061ef90b8dde10b2e9542f17a34c0fbcb5d.tar.bz2
dotty-3fe4e061ef90b8dde10b2e9542f17a34c0fbcb5d.zip
Rename NameExtractor -> NameKind
-rw-r--r--compiler/src/dotty/tools/dotc/ast/Desugar.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/ast/tpd.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/core/Denotations.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/core/NameExtractors.scala131
-rw-r--r--compiler/src/dotty/tools/dotc/core/NameOps.scala4
-rw-r--r--compiler/src/dotty/tools/dotc/core/Names.scala28
-rw-r--r--compiler/src/dotty/tools/dotc/core/SymDenotations.scala6
-rw-r--r--compiler/src/dotty/tools/dotc/core/Symbols.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/core/TypeApplications.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/core/Types.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala4
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala6
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/parsing/Parsers.scala3
-rw-r--r--compiler/src/dotty/tools/dotc/transform/AugmentScala2Traits.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/CapturedVars.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/Erasure.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/FirstTransform.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/LazyVals.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/LiftTry.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/Mixin.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala6
-rw-r--r--compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/SymUtils.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/TailRec.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/TryCatchPatterns.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Inliner.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Typer.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/util/FreshNameCreator.scala6
34 files changed, 121 insertions, 123 deletions
diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala
index 3671ccb73..288fadfd0 100644
--- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala
+++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala
@@ -6,7 +6,7 @@ import core._
import util.Positions._, Types._, Contexts._, Constants._, Names._, NameOps._, Flags._
import SymDenotations._, Symbols._, StdNames._, Annotations._, Trees._
import Decorators._
-import NameExtractors.{UniqueName, EvidenceParamName}
+import NameKinds.{UniqueName, EvidenceParamName}
import language.higherKinds
import typer.FrontEnd
import collection.mutable.ListBuffer
diff --git a/compiler/src/dotty/tools/dotc/ast/tpd.scala b/compiler/src/dotty/tools/dotc/ast/tpd.scala
index e4c6dd679..cd0115a99 100644
--- a/compiler/src/dotty/tools/dotc/ast/tpd.scala
+++ b/compiler/src/dotty/tools/dotc/ast/tpd.scala
@@ -12,7 +12,7 @@ import Denotations._, Decorators._, DenotTransformers._
import collection.mutable
import util.{Property, SourceFile, NoSource}
import typer.ErrorReporting._
-import NameExtractors.TempResultName
+import NameKinds.TempResultName
import scala.annotation.tailrec
import scala.io.Codec
diff --git a/compiler/src/dotty/tools/dotc/core/Denotations.scala b/compiler/src/dotty/tools/dotc/core/Denotations.scala
index 42837122a..fca77fc06 100644
--- a/compiler/src/dotty/tools/dotc/core/Denotations.scala
+++ b/compiler/src/dotty/tools/dotc/core/Denotations.scala
@@ -6,7 +6,7 @@ import SymDenotations.{ SymDenotation, ClassDenotation, NoDenotation }
import Contexts.{Context, ContextBase}
import Names._
import NameOps._
-import NameExtractors._
+import NameKinds._
import StdNames._
import Symbols.NoSymbol
import Symbols._
diff --git a/compiler/src/dotty/tools/dotc/core/NameExtractors.scala b/compiler/src/dotty/tools/dotc/core/NameExtractors.scala
index 1439ce002..7350087a5 100644
--- a/compiler/src/dotty/tools/dotc/core/NameExtractors.scala
+++ b/compiler/src/dotty/tools/dotc/core/NameExtractors.scala
@@ -11,22 +11,22 @@ import Decorators._
import Contexts.Context
import collection.mutable
-object NameExtractors {
+object NameKinds {
- @sharable private val simpleExtractors = new mutable.HashMap[Int, ClassifiedNameExtractor]
- @sharable private val uniqueExtractors = new mutable.HashMap[String, UniqueNameExtractor]
- @sharable private val qualifiedExtractors = new mutable.HashMap[String, QualifiedNameExtractor]
+ @sharable private val simpleNameKinds = new mutable.HashMap[Int, ClassifiedNameKind]
+ @sharable private val uniqueNameKinds = new mutable.HashMap[String, UniqueNameKind]
+ @sharable private val qualifiedNameKinds = new mutable.HashMap[String, QualifiedNameKind]
abstract class NameInfo extends DotClass {
- def extractor: NameExtractor
+ def kind: NameKind
def mkString(underlying: TermName): String
def map(f: SimpleTermName => SimpleTermName): NameInfo = this
}
- abstract class NameExtractor(val tag: Int) extends DotClass { self =>
+ abstract class NameKind(val tag: Int) extends DotClass { self =>
type ThisInfo <: Info
class Info extends NameInfo { this: ThisInfo =>
- def extractor = self
+ def kind = self
def mkString(underlying: TermName) = self.mkString(underlying, this)
override def toString = infoString
}
@@ -35,14 +35,14 @@ object NameExtractors {
def infoString: String
}
- object SimpleTermNameExtractor extends NameExtractor(UTF8) { self =>
+ object SimpleTermNameKind extends NameKind(UTF8) { self =>
type ThisInfo = Info
val info = new Info
def mkString(underlying: TermName, info: ThisInfo) = unsupported("mkString")
def infoString = unsupported("infoString")
}
- abstract class ClassifiedNameExtractor(tag: Int, val infoString: String) extends NameExtractor(tag) {
+ abstract class ClassifiedNameKind(tag: Int, val infoString: String) extends NameKind(tag) {
type ThisInfo = Info
val info = new Info
def apply(qual: TermName) =
@@ -51,17 +51,17 @@ object NameExtractors {
case DerivedTermName(underlying, `info`) => Some(underlying)
case _ => None
}
- simpleExtractors(tag) = this
+ simpleNameKinds(tag) = this
}
- class PrefixNameExtractor(tag: Int, prefix: String, optInfoString: String = "")
- extends ClassifiedNameExtractor(tag, if (optInfoString.isEmpty) s"Prefix $prefix" else optInfoString) {
+ class PrefixNameKind(tag: Int, prefix: String, optInfoString: String = "")
+ extends ClassifiedNameKind(tag, if (optInfoString.isEmpty) s"Prefix $prefix" else optInfoString) {
def mkString(underlying: TermName, info: ThisInfo) =
underlying.mapLast(n => termName(prefix + n.toString)).toString
}
- class SuffixNameExtractor(tag: Int, suffix: String, optInfoString: String = "")
- extends ClassifiedNameExtractor(tag, if (optInfoString.isEmpty) s"Suffix $suffix" else optInfoString) {
+ class SuffixNameKind(tag: Int, suffix: String, optInfoString: String = "")
+ extends ClassifiedNameKind(tag, if (optInfoString.isEmpty) s"Suffix $suffix" else optInfoString) {
def mkString(underlying: TermName, info: ThisInfo) = underlying.toString ++ suffix
}
@@ -69,8 +69,8 @@ object NameExtractors {
val name: SimpleTermName
}
- class QualifiedNameExtractor(tag: Int, val separator: String)
- extends NameExtractor(tag) {
+ class QualifiedNameKind(tag: Int, val separator: String)
+ extends NameKind(tag) {
type ThisInfo = QualInfo
case class QualInfo(val name: SimpleTermName) extends Info with QualifiedInfo {
override def map(f: SimpleTermName => SimpleTermName): NameInfo = new QualInfo(f(name))
@@ -89,7 +89,7 @@ object NameExtractors {
s"$underlying$separator${info.name}"
def infoString = s"Qualified $separator"
- qualifiedExtractors(separator) = this
+ qualifiedNameKinds(separator) = this
}
object AnyQualifiedName {
@@ -100,14 +100,13 @@ object NameExtractors {
}
}
- trait NumberedInfo {
+ trait NumberedInfo extends NameInfo {
def num: Int
- def extractor: NameExtractor
}
- abstract class NumberedNameExtractor(tag: Int, val infoString: String) extends NameExtractor(tag) { self =>
+ abstract class NumberedNameKind(tag: Int, val infoString: String) extends NameKind(tag) { self =>
type ThisInfo = NumberedInfo
- case class NumberedInfo(val num: Int) extends Info with NameExtractors.NumberedInfo {
+ case class NumberedInfo(val num: Int) extends Info with NameKinds.NumberedInfo {
override def toString = s"$infoString $num"
}
def apply(qual: TermName, num: Int) =
@@ -118,8 +117,8 @@ object NameExtractors {
}
}
- case class UniqueNameExtractor(val separator: String)
- extends NumberedNameExtractor(UNIQUE, s"Unique $separator") {
+ case class UniqueNameKind(val separator: String)
+ extends NumberedNameKind(UNIQUE, s"Unique $separator") {
override def definesNewName = true
def mkString(underlying: TermName, info: ThisInfo) = {
val safePrefix = str.sanitize(underlying.toString + separator)
@@ -129,62 +128,62 @@ object NameExtractors {
def fresh(prefix: TermName = EmptyTermName)(implicit ctx: Context): TermName =
ctx.freshNames.newName(prefix, this)
- uniqueExtractors(separator) = this
+ uniqueNameKinds(separator) = this
}
object AnyUniqueName {
def unapply(name: DerivedTermName): Option[(TermName, String, Int)] = name match {
case DerivedTermName(qual, info: NumberedInfo) =>
- info.extractor match {
- case unique: UniqueNameExtractor => Some((qual, unique.separator, info.num))
+ info.kind match {
+ case unique: UniqueNameKind => Some((qual, unique.separator, info.num))
case _ => None
}
case _ => None
}
}
- val QualifiedName = new QualifiedNameExtractor(QUALIFIED, ".")
- val FlattenedName = new QualifiedNameExtractor(FLATTENED, "$")
- val ExpandedName = new QualifiedNameExtractor(EXPANDED, str.EXPAND_SEPARATOR)
- val TraitSetterName = new QualifiedNameExtractor(TRAITSETTER, str.TRAIT_SETTER_SEPARATOR)
+ val QualifiedName = new QualifiedNameKind(QUALIFIED, ".")
+ val FlattenedName = new QualifiedNameKind(FLATTENED, "$")
+ val ExpandedName = new QualifiedNameKind(EXPANDED, str.EXPAND_SEPARATOR)
+ val TraitSetterName = new QualifiedNameKind(TRAITSETTER, str.TRAIT_SETTER_SEPARATOR)
- val UniqueName = new UniqueNameExtractor("$") {
+ val UniqueName = new UniqueNameKind("$") {
override def mkString(underlying: TermName, info: ThisInfo) =
if (underlying.isEmpty) "$" + info.num + "$" else super.mkString(underlying, info)
}
- val InlineAccessorName = new UniqueNameExtractor("$_inlineAccessor_$")
- val TempResultName = new UniqueNameExtractor("ev$")
- val EvidenceParamName = new UniqueNameExtractor("evidence$")
- val DepParamName = new UniqueNameExtractor("<param>")
- val LazyImplicitName = new UniqueNameExtractor("$_lazy_implicit_$")
- val LazyLocalName = new UniqueNameExtractor("$lzy")
- val LazyLocalInitName = new UniqueNameExtractor("$lzyINIT")
- val LazyFieldOffsetName = new UniqueNameExtractor("$OFFSET")
- val LazyBitMapName = new UniqueNameExtractor(nme.BITMAP_PREFIX.toString)
- val NonLocalReturnKeyName = new UniqueNameExtractor("nonLocalReturnKey")
- val WildcardParamName = new UniqueNameExtractor("_$")
- val TailLabelName = new UniqueNameExtractor("tailLabel")
- val ExceptionBinderName = new UniqueNameExtractor("ex")
- val SkolemName = new UniqueNameExtractor("?")
- val LiftedTreeName = new UniqueNameExtractor("liftedTree")
-
- val PatMatStdBinderName = new UniqueNameExtractor("x")
- val PatMatPiName = new UniqueNameExtractor("pi") // FIXME: explain what this is
- val PatMatPName = new UniqueNameExtractor("p") // FIXME: explain what this is
- val PatMatOName = new UniqueNameExtractor("o") // FIXME: explain what this is
- val PatMatCaseName = new UniqueNameExtractor("case")
- val PatMatMatchFailName = new UniqueNameExtractor("matchFail")
- val PatMatSelectorName = new UniqueNameExtractor("selector")
-
- object DefaultGetterName extends NumberedNameExtractor(DEFAULTGETTER, "DefaultGetter") {
+ val InlineAccessorName = new UniqueNameKind("$_inlineAccessor_$")
+ val TempResultName = new UniqueNameKind("ev$")
+ val EvidenceParamName = new UniqueNameKind("evidence$")
+ val DepParamName = new UniqueNameKind("<param>")
+ val LazyImplicitName = new UniqueNameKind("$_lazy_implicit_$")
+ val LazyLocalName = new UniqueNameKind("$lzy")
+ val LazyLocalInitName = new UniqueNameKind("$lzyINIT")
+ val LazyFieldOffsetName = new UniqueNameKind("$OFFSET")
+ val LazyBitMapName = new UniqueNameKind(nme.BITMAP_PREFIX.toString)
+ val NonLocalReturnKeyName = new UniqueNameKind("nonLocalReturnKey")
+ val WildcardParamName = new UniqueNameKind("_$")
+ val TailLabelName = new UniqueNameKind("tailLabel")
+ val ExceptionBinderName = new UniqueNameKind("ex")
+ val SkolemName = new UniqueNameKind("?")
+ val LiftedTreeName = new UniqueNameKind("liftedTree")
+
+ val PatMatStdBinderName = new UniqueNameKind("x")
+ val PatMatPiName = new UniqueNameKind("pi") // FIXME: explain what this is
+ val PatMatPName = new UniqueNameKind("p") // FIXME: explain what this is
+ val PatMatOName = new UniqueNameKind("o") // FIXME: explain what this is
+ val PatMatCaseName = new UniqueNameKind("case")
+ val PatMatMatchFailName = new UniqueNameKind("matchFail")
+ val PatMatSelectorName = new UniqueNameKind("selector")
+
+ object DefaultGetterName extends NumberedNameKind(DEFAULTGETTER, "DefaultGetter") {
def mkString(underlying: TermName, info: ThisInfo) = {
val prefix = if (underlying.isConstructorName) nme.DEFAULT_GETTER_INIT else underlying
prefix.toString + nme.DEFAULT_GETTER + (info.num + 1)
}
}
- object VariantName extends NumberedNameExtractor(VARIANT, "Variant") {
+ object VariantName extends NumberedNameKind(VARIANT, "Variant") {
val varianceToPrefix = Map(-1 -> '-', 0 -> '=', 1 -> '+')
val prefixToVariance = Map('-' -> -1, '=' -> 0, '+' -> 1)
def mkString(underlying: TermName, info: ThisInfo) = {
@@ -192,13 +191,13 @@ object NameExtractors {
}
}
- val SuperAccessorName = new PrefixNameExtractor(SUPERACCESSOR, "super$")
- val InitializerName = new PrefixNameExtractor(INITIALIZER, "initial$")
- val ShadowedName = new PrefixNameExtractor(SHADOWED, "(shadowed)")
- val AvoidClashName = new SuffixNameExtractor(AVOIDCLASH, "$_avoid_name_clash_$")
- val ModuleClassName = new SuffixNameExtractor(OBJECTCLASS, "$", optInfoString = "ModuleClass")
+ val SuperAccessorName = new PrefixNameKind(SUPERACCESSOR, "super$")
+ val InitializerName = new PrefixNameKind(INITIALIZER, "initial$")
+ val ShadowedName = new PrefixNameKind(SHADOWED, "(shadowed)")
+ val AvoidClashName = new SuffixNameKind(AVOIDCLASH, "$_avoid_name_clash_$")
+ val ModuleClassName = new SuffixNameKind(OBJECTCLASS, "$", optInfoString = "ModuleClass")
- object SignedName extends NameExtractor(63) {
+ object SignedName extends NameKind(63) {
/** @param parts resultSig followed by paramsSig */
case class SignedInfo(sig: Signature) extends Info {
@@ -217,7 +216,7 @@ object NameExtractors {
def infoString: String = "Signed"
}
- def simpleExtractorOfTag : collection.Map[Int, ClassifiedNameExtractor] = simpleExtractors
- def qualifiedExtractorOfSeparator: collection.Map[String, QualifiedNameExtractor] = qualifiedExtractors
- def uniqueExtractorOfSeparator : collection.Map[String, UniqueNameExtractor] = uniqueExtractors
+ def simpleNameKindOfTag : collection.Map[Int, ClassifiedNameKind] = simpleNameKinds
+ def qualifiedNameKindOfSeparator: collection.Map[String, QualifiedNameKind] = qualifiedNameKinds
+ def uniqueNameKindOfSeparator : collection.Map[String, UniqueNameKind] = uniqueNameKinds
} \ No newline at end of file
diff --git a/compiler/src/dotty/tools/dotc/core/NameOps.scala b/compiler/src/dotty/tools/dotc/core/NameOps.scala
index 6f2c75313..356b41efb 100644
--- a/compiler/src/dotty/tools/dotc/core/NameOps.scala
+++ b/compiler/src/dotty/tools/dotc/core/NameOps.scala
@@ -4,7 +4,7 @@ package core
import java.security.MessageDigest
import scala.annotation.switch
import scala.io.Codec
-import Names._, StdNames._, Contexts._, Symbols._, Flags._, NameExtractors._
+import Names._, StdNames._, Contexts._, Symbols._, Flags._, NameKinds._
import Decorators.PreNamedString
import util.{Chars, NameTransformer}
import Chars.isOperatorPart
@@ -136,7 +136,7 @@ object NameOps {
def expandedName(prefix: Name, separator: Name = nme.EXPAND_SEPARATOR): N =
likeTyped {
def qualify(name: SimpleTermName) =
- qualifiedExtractorOfSeparator(separator.toString)(prefix.toTermName, name)
+ qualifiedNameKindOfSeparator(separator.toString)(prefix.toTermName, name)
name rewrite {
case name: SimpleTermName =>
qualify(name)
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 {
diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala
index 5e5a5df2d..3d0b306c0 100644
--- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -4,7 +4,7 @@ package core
import Periods._, Contexts._, Symbols._, Denotations._, Names._, NameOps._, Annotations._
import Types._, Flags._, Decorators._, DenotTransformers._, StdNames._, Scopes._, Comments._
-import NameOps._, NameExtractors._
+import NameOps._, NameKinds._
import Scopes.Scope
import collection.mutable
import collection.immutable.BitSet
@@ -406,14 +406,14 @@ object SymDenotations {
}
var prefix = encl.fullNameSeparated(separator)
val fn =
- if (qualifiedExtractorOfSeparator.contains(sep)) {
+ if (qualifiedNameKindOfSeparator.contains(sep)) {
if (sep == "$")
// duplicate scalac's behavior: don't write a double '$$' for module class members.
prefix = prefix.exclude(ModuleClassName)
name rewrite {
case n: SimpleTermName =>
val n1 = if (filler.isEmpty) n else termName(filler ++ n)
- qualifiedExtractorOfSeparator(sep)(prefix.toTermName, n1)
+ qualifiedNameKindOfSeparator(sep)(prefix.toTermName, n1)
}
}
else {
diff --git a/compiler/src/dotty/tools/dotc/core/Symbols.scala b/compiler/src/dotty/tools/dotc/core/Symbols.scala
index 69d6e8db3..e0d9aca2b 100644
--- a/compiler/src/dotty/tools/dotc/core/Symbols.scala
+++ b/compiler/src/dotty/tools/dotc/core/Symbols.scala
@@ -19,7 +19,7 @@ import util.Positions._
import DenotTransformers._
import StdNames._
import NameOps._
-import NameExtractors.LazyImplicitName
+import NameKinds.LazyImplicitName
import ast.tpd.Tree
import ast.TreeTypeMap
import Constants.Constant
diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala
index 0220928a2..82051b66c 100644
--- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala
+++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -11,7 +11,7 @@ import util.Stats._
import util.common._
import Names._
import NameOps._
-import NameExtractors._
+import NameKinds._
import Flags._
import StdNames.tpnme
import util.Positions.Position
diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala
index 3f5a30922..c8c1886cc 100644
--- a/compiler/src/dotty/tools/dotc/core/Types.scala
+++ b/compiler/src/dotty/tools/dotc/core/Types.scala
@@ -7,7 +7,7 @@ import Symbols._
import Flags._
import Names._
import StdNames._, NameOps._
-import NameExtractors.{ShadowedName, SkolemName}
+import NameKinds.{ShadowedName, SkolemName}
import Scopes._
import Constants._
import Contexts._
diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala
index c5194fb93..13315eb3e 100644
--- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala
+++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala
@@ -5,7 +5,7 @@ package classfile
import Contexts._, Symbols._, Types._, Names._, StdNames._, NameOps._, Scopes._, Decorators._
import SymDenotations._, unpickleScala2.Scala2Unpickler._, Constants._, Annotations._, util.Positions._
-import NameExtractors.ModuleClassName
+import NameKinds.ModuleClassName
import ast.tpd._
import java.io.{ File, IOException }
import java.lang.Integer.toHexString
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala b/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala
index 2fd078bef..6df96a9a0 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala
@@ -6,7 +6,7 @@ package tasty
import collection.mutable
import Names.{Name, chrs, SimpleTermName, DerivedTermName}
import NameOps.NameDecorator
-import NameExtractors._
+import NameKinds._
import Decorators._
import TastyBuffer._
import scala.io.Codec
@@ -53,7 +53,7 @@ class NameBuffer extends TastyBuffer(10000) {
def writeNameRef(name: Name): Unit = writeNameRef(nameRefs(name.toTermName))
def pickleNameContents(name: Name): Unit = {
- val tag = name.toTermName.info.extractor.tag
+ val tag = name.toTermName.info.kind.tag
writeByte(tag)
name.toTermName match {
case name: SimpleTermName =>
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala
index 756b7db5c..a14691ed5 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala
@@ -6,7 +6,7 @@ import scala.collection.mutable
import TastyFormat._
import TastyBuffer.NameRef
import Names.{Name, TermName, termName, EmptyTermName}
-import NameExtractors._
+import NameKinds._
import java.util.UUID
object TastyUnpickler {
@@ -60,7 +60,7 @@ class TastyUnpickler(reader: TastyReader) {
val num = readNat()
val originals = until(end)(readName())
val original = if (originals.isEmpty) EmptyTermName else originals.head
- uniqueExtractorOfSeparator(separator)(original, num)
+ uniqueNameKindOfSeparator(separator)(original, num)
case DEFAULTGETTER =>
DefaultGetterName(readName(), readNat())
case VARIANT =>
@@ -73,7 +73,7 @@ class TastyUnpickler(reader: TastyReader) {
if (sig == Signature.NotAMethod) sig = Signature.NotAMethod
SignedName(original, sig)
case _ =>
- simpleExtractorOfTag(tag)(readName())
+ simpleNameKindOfTag(tag)(readName())
}
assert(currentAddr == end, s"bad name $result $start $currentAddr $end")
result
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
index 355eef1ca..5d33738c2 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
@@ -9,7 +9,7 @@ import TastyFormat._
import Contexts._, Symbols._, Types._, Names._, Constants._, Decorators._, Annotations._, StdNames.tpnme, NameOps._
import collection.mutable
import typer.Inliner
-import NameOps._, NameExtractors._
+import NameOps._, NameKinds._
import StdNames.nme
import TastyBuffer._
import TypeApplications._
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
index b8e6bbdf0..96bf29a70 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
@@ -5,7 +5,7 @@ package tasty
import Contexts._, Symbols._, Types._, Scopes._, SymDenotations._, Names._, NameOps._
import StdNames._, Denotations._, Flags._, Constants._, Annotations._
-import NameExtractors._
+import NameKinds._
import util.Positions._
import ast.{tpd, Trees, untpd}
import Trees._
diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala
index d0451dd60..3112be659 100644
--- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala
+++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -12,7 +12,7 @@ import core._
import Flags._
import Contexts._
import Names._
-import NameExtractors.WildcardParamName
+import NameKinds.WildcardParamName
import ast.{Positioned, Trees, untpd}
import ast.Trees._
import Decorators._
@@ -21,7 +21,6 @@ import util.Positions._
import Constants._
import ScriptParsers._
import Comments._
-
import scala.annotation.{tailrec, switch}
import util.DotClass
import rewrite.Rewrites.patch
diff --git a/compiler/src/dotty/tools/dotc/transform/AugmentScala2Traits.scala b/compiler/src/dotty/tools/dotc/transform/AugmentScala2Traits.scala
index fa79d995c..a8d82045e 100644
--- a/compiler/src/dotty/tools/dotc/transform/AugmentScala2Traits.scala
+++ b/compiler/src/dotty/tools/dotc/transform/AugmentScala2Traits.scala
@@ -14,7 +14,7 @@ import DenotTransformers._
import Annotations._
import StdNames._
import NameOps._
-import NameExtractors._
+import NameKinds._
import ast.Trees._
/** This phase augments Scala2 traits with implementation classes and with additional members
diff --git a/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala b/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala
index 368250cdf..b9a9544f5 100644
--- a/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala
+++ b/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala
@@ -12,7 +12,7 @@ import core.SymDenotations._
import core.StdNames.nme
import core.Names._
import core.NameOps._
-import core.NameExtractors.TempResultName
+import core.NameKinds.TempResultName
import ast.Trees._
import SymUtils._
import collection.{ mutable, immutable }
diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala
index e9fe42e78..4cee0d0de 100644
--- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala
+++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala
@@ -11,7 +11,7 @@ import core.Types._
import core.Names._
import core.StdNames._
import core.NameOps._
-import core.NameExtractors.ShadowedName
+import core.NameKinds.ShadowedName
import core.Decorators._
import core.Constants._
import core.Definitions._
diff --git a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala
index 803504944..37f978f11 100644
--- a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala
+++ b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala
@@ -20,7 +20,7 @@ import scala.collection.mutable
import DenotTransformers._
import typer.Checking
import NameOps._
-import NameExtractors.AvoidClashName
+import NameKinds.AvoidClashName
import StdNames._
diff --git a/compiler/src/dotty/tools/dotc/transform/LazyVals.scala b/compiler/src/dotty/tools/dotc/transform/LazyVals.scala
index 357baa3df..f64006d73 100644
--- a/compiler/src/dotty/tools/dotc/transform/LazyVals.scala
+++ b/compiler/src/dotty/tools/dotc/transform/LazyVals.scala
@@ -10,7 +10,7 @@ import Contexts._
import Symbols._
import Decorators._
import NameOps._
-import NameExtractors._
+import NameKinds._
import StdNames.nme
import rewrite.Rewrites.patch
import util.Positions.Position
diff --git a/compiler/src/dotty/tools/dotc/transform/LiftTry.scala b/compiler/src/dotty/tools/dotc/transform/LiftTry.scala
index 61554f5ce..278868131 100644
--- a/compiler/src/dotty/tools/dotc/transform/LiftTry.scala
+++ b/compiler/src/dotty/tools/dotc/transform/LiftTry.scala
@@ -8,7 +8,7 @@ import core.Contexts._
import core.Types._
import core.Flags._
import core.Decorators._
-import core.NameExtractors.LiftedTreeName
+import core.NameKinds.LiftedTreeName
import NonLocalReturns._
/** Lifts try's that might be executed on non-empty expression stacks
diff --git a/compiler/src/dotty/tools/dotc/transform/Mixin.scala b/compiler/src/dotty/tools/dotc/transform/Mixin.scala
index fc23d96ee..546077d27 100644
--- a/compiler/src/dotty/tools/dotc/transform/Mixin.scala
+++ b/compiler/src/dotty/tools/dotc/transform/Mixin.scala
@@ -13,7 +13,7 @@ import Decorators._
import DenotTransformers._
import StdNames._
import NameOps._
-import NameExtractors._
+import NameKinds._
import Phases._
import ast.untpd
import ast.Trees._
diff --git a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala
index 945504743..fdee076b4 100644
--- a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala
+++ b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala
@@ -5,7 +5,7 @@ import core._
import Contexts._, Symbols._, Types._, Flags._, Decorators._, StdNames._, Constants._, Phases._
import TreeTransforms._
import ast.Trees._
-import NameExtractors.NonLocalReturnKeyName
+import NameKinds.NonLocalReturnKeyName
import collection.mutable
object NonLocalReturns {
diff --git a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
index f93eac0a2..d87412d93 100644
--- a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
+++ b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
@@ -11,7 +11,7 @@ import core.Symbols._
import core.Types._
import core.Constants._
import core.StdNames._
-import core.NameExtractors._
+import core.NameKinds._
import dotty.tools.dotc.ast.{untpd, TreeTypeMap, tpd}
import dotty.tools.dotc.core
import dotty.tools.dotc.core.DenotTransformers.DenotTransformer
@@ -73,11 +73,11 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
trait CodegenCore {
// assert(owner ne null); assert(owner ne NoSymbol)
- def freshSym(pos: Position, tp: Type = NoType, unique: UniqueNameExtractor = PatMatStdBinderName, owner: Symbol = ctx.owner) = {
+ def freshSym(pos: Position, tp: Type = NoType, unique: UniqueNameKind = PatMatStdBinderName, owner: Symbol = ctx.owner) = {
ctx.newSymbol(owner, unique.fresh(), Flags.Synthetic | Flags.Case, tp, coord = pos)
}
- def newSynthCaseLabel(unique: UniqueNameExtractor, tpe: Type, owner: Symbol = ctx.owner) =
+ def newSynthCaseLabel(unique: UniqueNameKind, tpe: Type, owner: Symbol = ctx.owner) =
ctx.newSymbol(owner, unique.fresh(), Flags.Label | Flags.Synthetic | Flags.Method, tpe).asTerm
//NoSymbol.newLabel(freshName(name), NoPosition) setFlag treeInfo.SYNTH_CASE_FLAGS
diff --git a/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala b/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala
index 1df10cac2..e7936e8d9 100644
--- a/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala
+++ b/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala
@@ -13,7 +13,7 @@ import Decorators._
import DenotTransformers._
import StdNames._
import NameOps._
-import NameExtractors._
+import NameKinds._
import ast.Trees._
import util.Positions._
import Names._
diff --git a/compiler/src/dotty/tools/dotc/transform/SymUtils.scala b/compiler/src/dotty/tools/dotc/transform/SymUtils.scala
index 1b3018d9b..4c07ca4c8 100644
--- a/compiler/src/dotty/tools/dotc/transform/SymUtils.scala
+++ b/compiler/src/dotty/tools/dotc/transform/SymUtils.scala
@@ -10,7 +10,7 @@ import Decorators._
import Names._
import StdNames._
import NameOps._
-import NameExtractors._
+import NameKinds._
import Flags._
import Annotations._
diff --git a/compiler/src/dotty/tools/dotc/transform/TailRec.scala b/compiler/src/dotty/tools/dotc/transform/TailRec.scala
index 87e9c1013..10c18e165 100644
--- a/compiler/src/dotty/tools/dotc/transform/TailRec.scala
+++ b/compiler/src/dotty/tools/dotc/transform/TailRec.scala
@@ -10,7 +10,7 @@ import DenotTransformers.DenotTransformer
import Denotations.SingleDenotation
import Symbols._
import Types._
-import NameExtractors.TailLabelName
+import NameKinds.TailLabelName
import TreeTransforms.{MiniPhaseTransform, TransformerInfo}
/**
diff --git a/compiler/src/dotty/tools/dotc/transform/TryCatchPatterns.scala b/compiler/src/dotty/tools/dotc/transform/TryCatchPatterns.scala
index a651c0c74..44d26e7dd 100644
--- a/compiler/src/dotty/tools/dotc/transform/TryCatchPatterns.scala
+++ b/compiler/src/dotty/tools/dotc/transform/TryCatchPatterns.scala
@@ -5,7 +5,7 @@ import core.Symbols._
import core.StdNames._
import ast.Trees._
import core.Types._
-import core.NameExtractors.ExceptionBinderName
+import core.NameKinds.ExceptionBinderName
import dotty.tools.dotc.core.Decorators._
import dotty.tools.dotc.core.Flags
import dotty.tools.dotc.core.Contexts.Context
diff --git a/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala b/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala
index 3f3a0cce3..22acd112b 100644
--- a/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala
+++ b/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala
@@ -12,7 +12,7 @@ import Symbols._
import Decorators._
import Names._
import StdNames._
-import NameExtractors.UniqueName
+import NameKinds.UniqueName
import Trees._
import Inferencing._
import util.Positions._
diff --git a/compiler/src/dotty/tools/dotc/typer/Inliner.scala b/compiler/src/dotty/tools/dotc/typer/Inliner.scala
index ad65af98c..eaabb0689 100644
--- a/compiler/src/dotty/tools/dotc/typer/Inliner.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Inliner.scala
@@ -15,7 +15,7 @@ import StdNames.nme
import Contexts.Context
import Names.{Name, TermName}
import NameOps._
-import NameExtractors.InlineAccessorName
+import NameKinds.InlineAccessorName
import SymDenotations.SymDenotation
import Annotations._
import transform.ExplicitOuter
diff --git a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
index 03357fee3..398a7a17e 100644
--- a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
+++ b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
@@ -5,7 +5,7 @@ package typer
import core._
import ast._
import Contexts._, Types._, Flags._, Denotations._, Names._, StdNames._, NameOps._, Symbols._
-import NameExtractors.DepParamName
+import NameKinds.DepParamName
import Trees._
import Constants._
import Scopes._
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala
index 8674c8fbd..e6236d122 100644
--- a/compiler/src/dotty/tools/dotc/typer/Typer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -18,7 +18,7 @@ import SymDenotations._
import Annotations._
import Names._
import NameOps._
-import NameExtractors._
+import NameKinds._
import Flags._
import Decorators._
import ErrorReporting._
diff --git a/compiler/src/dotty/tools/dotc/util/FreshNameCreator.scala b/compiler/src/dotty/tools/dotc/util/FreshNameCreator.scala
index 529e30f05..5dbec3e5a 100644
--- a/compiler/src/dotty/tools/dotc/util/FreshNameCreator.scala
+++ b/compiler/src/dotty/tools/dotc/util/FreshNameCreator.scala
@@ -4,11 +4,11 @@ package util
import scala.collection.mutable
import core.Names.TermName
-import core.NameExtractors.UniqueNameExtractor
+import core.NameKinds.UniqueNameKind
import core.StdNames.str
abstract class FreshNameCreator {
- def newName(prefix: TermName, unique: UniqueNameExtractor): TermName
+ def newName(prefix: TermName, unique: UniqueNameKind): TermName
}
object FreshNameCreator {
@@ -21,7 +21,7 @@ object FreshNameCreator {
* that the returned name has never been returned by a previous
* call to this function (provided the prefix does not end in a digit).
*/
- def newName(prefix: TermName, unique: UniqueNameExtractor): TermName = {
+ def newName(prefix: TermName, unique: UniqueNameKind): TermName = {
val key = str.sanitize(prefix.toString + unique.separator)
counters(key) += 1
val counter = counters(key)