summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-07-25 04:36:58 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-07-25 04:36:58 -0700
commitc3ac0ec12ee2b08917cdd0379b868a2fb12171d8 (patch)
tree0417f031e6ebd1ae91845eb3fc7156e550db4ef9 /src/library
parent41ee45eb86ae20875d2c79403d3436a65d2b125f (diff)
parent2926dfc526296e6575a0a54f68e07c7e7d6d347e (diff)
downloadscala-c3ac0ec12ee2b08917cdd0379b868a2fb12171d8.tar.gz
scala-c3ac0ec12ee2b08917cdd0379b868a2fb12171d8.tar.bz2
scala-c3ac0ec12ee2b08917cdd0379b868a2fb12171d8.zip
Merge pull request #986 from scalamacros/ticket/6075
SI-6075 cleans up api.StandardNames
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/reflect/base/Base.scala21
-rw-r--r--src/library/scala/reflect/base/StandardNames.scala17
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
}
}