diff options
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/reflect/base/Base.scala | 21 | ||||
-rw-r--r-- | src/library/scala/reflect/base/StandardNames.scala | 17 |
2 files changed, 22 insertions, 16 deletions
diff --git a/src/library/scala/reflect/base/Base.scala b/src/library/scala/reflect/base/Base.scala index 5df48307fe..53854f160d 100644 --- a/src/library/scala/reflect/base/Base.scala +++ b/src/library/scala/reflect/base/Base.scala @@ -52,7 +52,6 @@ class Base extends Universe { self => else if (isFreeTerm) "free term" else if (isTerm) "value" else "symbol" - // [Eugene++ to Martin] base names should expose `decode` override def toString() = s"$kindString $name" } implicit val SymbolTag = ClassTag[Symbol](classOf[Symbol]) @@ -204,20 +203,22 @@ class Base extends Universe { self => object nme extends TermNamesBase { type NameType = TermName - val EMPTY = newTermName("") - val ROOT = newTermName("<root>") - val EMPTY_PACKAGE_NAME = newTermName("<empty>") - val CONSTRUCTOR = newTermName("<init>") + val WILDCARD = newTermName("_") + val CONSTRUCTOR = newTermName("<init>") + val ROOTPKG = newTermName("_root_") + val EMPTY = newTermName("") + val EMPTY_PACKAGE_NAME = newTermName("<empty>") + val ROOT = newTermName("<root>") val NO_NAME = newTermName("<none>") - val WILDCARD = newTermName("_") } object tpnme extends TypeNamesBase { type NameType = TypeName - val EMPTY = nme.EMPTY.toTypeName - val ROOT = nme.ROOT.toTypeName - val EMPTY_PACKAGE_NAME = nme.EMPTY_PACKAGE_NAME.toTypeName - val WILDCARD = nme.WILDCARD.toTypeName + val WILDCARD = nme.WILDCARD.toTypeName + val EMPTY = nme.EMPTY.toTypeName + val WILDCARD_STAR = newTypeName("_*") + val EMPTY_PACKAGE_NAME = nme.EMPTY_PACKAGE_NAME.toTypeName + val ROOT = nme.ROOT.toTypeName } type FlagSet = Long diff --git a/src/library/scala/reflect/base/StandardNames.scala b/src/library/scala/reflect/base/StandardNames.scala index 8a3fbe9683..50399a4a1e 100644 --- a/src/library/scala/reflect/base/StandardNames.scala +++ b/src/library/scala/reflect/base/StandardNames.scala @@ -6,6 +6,11 @@ package scala.reflect package base +// Q: I have a pretty name. Where do I put it - into base.StandardNames or into api.StandardNames? +// A: Is it necessary to construct trees (like EMPTY or WILDCARD_STAR)? If yes, then it goes to base.StandardNames. +// Is it necessary to perform reflection (like ERROR or LOCAL_SUFFIX_STRING)? If yes, then it goes to api.StandardNames. +// Otherwise it goes nowhere - reflection API should stay minimalistic. + trait StandardNames { self: Universe => @@ -14,16 +19,16 @@ trait StandardNames { trait NamesBase { type NameType >: Null <: Name - val EMPTY: NameType - val ROOT: NameType - val EMPTY_PACKAGE_NAME: NameType val WILDCARD: NameType } - trait TypeNamesBase extends NamesBase - trait TermNamesBase extends NamesBase { val CONSTRUCTOR: TermName - val NO_NAME: NameType + val ROOTPKG: TermName + } + + trait TypeNamesBase extends NamesBase { + val EMPTY: NameType + val WILDCARD_STAR: NameType } } |