summaryrefslogtreecommitdiff
path: root/src/library/scala/reflect/generic/StdNames.scala
blob: 03cee8c909c1e99e7db3d42f02bcccf235a81176 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package scala.reflect
package generic

trait StdNames { self: Universe =>

  val nme: StandardNames

  class StandardNames {
    val EXPAND_SEPARATOR_STRING = "$$"
    val LOCAL_SUFFIX_STRING = " "

    val ANON_CLASS_NAME    = newTermName("$anon")
    val ANON_FUN_NAME      = newTermName("$anonfun")
    val EMPTY_PACKAGE_NAME = newTermName("<empty>")
    val IMPORT             = newTermName("<import>")
    val REFINE_CLASS_NAME  = newTermName("<refinement>")
    val ROOT               = newTermName("<root>")
    val ROOTPKG            = newTermName("_root_")
    val EMPTY              = newTermName("")
    val MODULE_SUFFIX      = newTermName("$module")

    /** The expanded name of `name' relative to this class `base` with given `separator`
     */
    def expandedName(name: Name, base: Symbol, separator: String = EXPAND_SEPARATOR_STRING): Name =
      newTermName(base.fullName('$') + separator + name)

    def moduleVarName(name: Name): Name =
      newTermName(name.toString() + MODULE_SUFFIX)
  }
}