<commit_before>package dotty.tools.dotc
package core

import scala.language.implicitConversions
import scala.collection.{mutable, immutable}
import scala.annotation.switch
import Names._
import Symbols._
import Contexts._
import Decorators.StringDecorator
import util.NameTransformer
import scala.collection.breakOut

object StdNames {

/** Base strings from which synthetic names are derived. */

  abstract class DefinedNames[N <: Name] {
    protected implicit def fromString(s: String): N
    protected def fromName(name: Name): N = fromString(name.toString)

    private val kws = mutable.Set[N]()
    protected def kw(name: N) = { kws += name; name }

    final val keywords: collection.Set[N] = kws
  }

  abstract class ScalaNames[N <: Name] extends DefinedNames[N] {
    protected def encode(s: String): N = fromName(fromString(s).encode)

// Keywords, need to come first -----------------------

    final val ABSTRACTkw: N  = kw("abstract")
    final val CASEkw: N      = kw("case")
    final val CLASSkw: N     = kw("class")
    final val CATCHkw: N     = kw("catch")
    final val DEFkw: N       = kw("def")
    final val DOkw: N        = kw("do")
    final val ELSEkw: N      = kw("else")
    final val EXTENDSkw: N   = kw("extends")
    final val FALSEkw: N     = kw("false")
    final val FINALkw: N     = kw("final")
    final val FINALLYkw: N   = kw("finally")
    final val FORkw: N       = kw("for")
    final val FORSOMEkw: N   = kw("forSome")
    final val IFkw: N        = kw("if")
    final val IMPLICITkw: N  = kw("implicit")
    final val IMPORTkw: N    = kw("import")
    final val LAZYkw: N      = kw("lazy")
    final val MACROkw: N     = kw("macro")
    final val MATCHkw: N     = kw("match")
    final val NEWkw: N       = kw("new")
    final val NULLkw: N      = kw("null")
    final val OBJECTkw: N    = kw("object")
    final val OVERRIDEkw: N  = kw("override")
    final val PACKAGEkw: N   = kw("package")
    final val PRIVATEkw: N   = kw("private")
    final val PROTECTEDkw: N = kw("protected")
    final val RETURNkw: N    = kw("return")
    final val SEALEDkw: N    = kw("sealed")
    final val SUPERkw: N     = kw("super")
    final val THENkw: N      = kw("then")
    final val THISkw: N      = kw("this")
    final val THROWkw: N     = kw("throw")
    final val TRAITkw: N     = kw("trait")
    final val TRUEkw: N      = kw("true")
    final val TRYkw: N       = kw("try")
    final val TYPEkw: N      = kw("type")
    final val VALkw: N       = kw("val")
    final val VARkw: N       = kw("var")
    final val WITHkw: N      = kw("with")
    final val WHILEkw: N     = kw("while")
    final val YIELDkw: N     = kw("yield")
    final val DOTkw: N       = kw(".")
    final val USCOREkw: N    = kw("_")
    final val COLONkw: N     = kw(":")
    final val EQUALSkw: N    = kw("=")
    final val ARROWkw: N     = kw("=>")
    final val LARROWkw: N    = kw("<-")
    final val SUBTYPEkw: N   = kw("<:")
    final val VIEWBOUNDkw: N = kw("<%")
    final val SUPERTYPEkw: N = kw(">:")
    final val HASHkw: N      = kw("#")
    final val ATkw: N        = kw("@")

    val ANON_CLASS: N                 = "$anon"
    val ANON_FUN: N                   = "$anonfun"
    val BITMAP_PREFIX: N              = "bitmap$"
    val BITMAP_NORMAL: N              = BITMAP_PREFIX         // initialization bitmap for public/protected lazy vals
    val BITMAP_TRANSIENT: N           = BITMAP_PREFIX + "trans$"    // initialization bitmap for transient lazy vals
    val BITMAP_CHECKINIT: N           = BITMAP_PREFIX + "init$"      // initialization bitmap for checkinit values
    val BITMAP_CHECKINIT_TRANSIENT: N = BITMAP_PREFIX + "inittrans$" // initialization bitmap for transient checkinit values
    val DEFAULT_GETTER: N             = "$default$"
    val DEFAULT_GETTER_INIT: N        = NameTransformer.encode("<init>")
    val DO_WHILE_PREFIX: N            = "doWhile$"
    val EMPTY: N                      = ""
    val EMPTY_PACKAGE: N              = Names.EMPTY_PACKAGE.toString
    val EVIDENCE_PARAM_PREFIX: N      = "evidence$"
    val EXCEPTION_RESULT_PREFIX: N    = "exceptionResult"
    val EXPAND_SEPARATOR: N           = "$$"
    val IMPL_CLASS_SUFFIX: N          = "$class"
    val IMPORT: N                     = "<import>"
    val INTERPRETER_IMPORT_WRAPPER: N = "$iw"
    val INTERPRETER_LINE_PREFIX: N    = "line"
    val INTERPRETER_VAR_PREFIX: N     = "res"
    val INTERPRETER_WRAPPER_SUFFIX: N = "$object"
    val LOCALDUMMY_PREFIX: N          = "<local "       // owner of local blocks
    val MODULE_SUFFIX: N              = NameTransformer.MODULE_SUFFIX_STRING
    val AVOID_CLASH_SUFFIX: N         = "$_avoid_name_clash_$"
    val MODULE_VAR_SUFFIX: N          = "$module"
    val NAME_JOIN: N                  = NameTransformer.NAME_JOIN_STRING
    val USCORE_PARAM_PREFIX: N        = "_$"
    val OPS_PACKAGE: N                = "<special-ops>"
    val OVERLOADED: N                 = "<overloaded>"
    val PACKAGE: N                    = "package"
    val PACKAGE_CLS: N                = "package$"
    val PROTECTED_PREFIX: N           = "protected$"
    val PROTECTED_SET_PREFIX: N       = PROTECTED_PREFIX + "set"
    val ROOT: N                       = "<root>"
    val SHADOWED: N                   = "(shadowed)"  // tag to be used until we have proper name kinds
    val SINGLETON_SUFFIX: N           = ".type"
    val SPECIALIZED_SUFFIX: N         = "$sp"
    val SUPER_PREFIX: N               = "super$"
    val WHILE_PREFIX: N               = "while$"
    val DEFAULT_EXCEPTION_NAME: N     = "ex$"
    val INITIALIZER_PREFIX: N         = "initial$"
    val COMPANION_MODULE_METHOD: N    = "companion$module"
    val COMPANION_CLASS_METHOD: N     = "compaion$class"

    // value types (and AnyRef) are all used as terms as well
    // as (at least) arguments to the @specialize annotation.
    final val Boolean: N = "Boolean"<commit_msg>Fix companion_class_method name<commit_after>package dotty.tools.dotc
package core

import scala.language.implicitConversions
import scala.collection.{mutable, immutable}
import scala.annotation.switch
import Names._
import Symbols._
import Contexts._
import Decorators.StringDecorator
import util.NameTransformer
import scala.collection.breakOut

object StdNames {

/** Base strings from which synthetic names are derived. */

  abstract class DefinedNames[N <: Name] {
    protected implicit def fromString(s: String): N
    protected def fromName(name: Name): N = fromString(name.toString)

    private val kws = mutable.Set[N]()
    protected def kw(name: N) = { kws += name; name }

    final val keywords: collection.Set[N] = kws
  }

  abstract class ScalaNames[N <: Name] extends DefinedNames[N] {
    protected def encode(s: String): N = fromName(fromString(s).encode)

// Keywords, need to come first -----------------------

    final val ABSTRACTkw: N  = kw("abstract")
    final val CASEkw: N      = kw("case")
    final val CLASSkw: N     = kw("class")
    final val CATCHkw: N     = kw("catch")
    final val DEFkw: N       = kw("def")
    final val DOkw: N        = kw("do")
    final val ELSEkw: N      = kw("else")
    final val EXTENDSkw: N   = kw("extends")
    final val FALSEkw: N     = kw("false")
    final val FINALkw: N     = kw("final")
    final val FINALLYkw: N   = kw("finally")
    final val FORkw: N       = kw("for")
    final val FORSOMEkw: N   = kw("forSome")
    final val IFkw: N        = kw("if")
    final val IMPLICITkw: N  = kw("implicit")
    final val IMPORTkw: N    = kw("import")
    final val LAZYkw: N      = kw("lazy")
    final val MACROkw: N     = kw("macro")
    final val MATCHkw: N     = kw("match")
    final val NEWkw: N       = kw("new")
    final val NULLkw: N      = kw("null")
    final val OBJECTkw: N    = kw("object")
    final val OVERRIDEkw: N  = kw("override")
    final val PACKAGEkw: N   = kw("package")
    final val PRIVATEkw: N   = kw("private")
    final val PROTECTEDkw: N = kw("protected")
    final val RETURNkw: N    = kw("return")
    final val SEALEDkw: N    = kw("sealed")
    final val SUPERkw: N     = kw("super")
    final val THENkw: N      = kw("then")
    final val THISkw: N      = kw("this")
    final val THROWkw: N     = kw("throw")
    final val TRAITkw: N     = kw("trait")
    final val TRUEkw: N      = kw("true")
    final val TRYkw: N       = kw("try")
    final val TYPEkw: N      = kw("type")
    final val VALkw: N       = kw("val")
    final val VARkw: N       = kw("var")
    final val WITHkw: N      = kw("with")
    final val WHILEkw: N     = kw("while")
    final val YIELDkw: N     = kw("yield")
    final val DOTkw: N       = kw(".")
    final val USCOREkw: N    = kw("_")
    final val COLONkw: N     = kw(":")
    final val EQUALSkw: N    = kw("=")
    final val ARROWkw: N     = kw("=>")
    final val LARROWkw: N    = kw("<-")
    final val SUBTYPEkw: N   = kw("<:")
    final val VIEWBOUNDkw: N = kw("<%")
    final val SUPERTYPEkw: N = kw(">:")
    final val HASHkw: N      = kw("#")
    final val ATkw: N        = kw("@")

    val ANON_CLASS: N                 = "$anon"
    val ANON_FUN: N                   = "$anonfun"
    val BITMAP_PREFIX: N              = "bitmap$"
    val BITMAP_NORMAL: N              = BITMAP_PREFIX         // initialization bitmap for public/protected lazy vals
    val BITMAP_TRANSIENT: N           = BITMAP_PREFIX + "trans$"    // initialization bitmap for transient lazy vals
    val BITMAP_CHECKINIT: N           = BITMAP_PREFIX + "init$"      // initialization bitmap for checkinit values
    val BITMAP_CHECKINIT_TRANSIENT: N = BITMAP_PREFIX + "inittrans$" // initialization bitmap for transient checkinit values
    val DEFAULT_GETTER: N             = "$default$"
    val DEFAULT_GETTER_INIT: N        = NameTransformer.encode("<init>")
    val DO_WHILE_PREFIX: N            = "doWhile$"
    val EMPTY: N                      = ""
    val EMPTY_PACKAGE: N              = Names.EMPTY_PACKAGE.toString
    val EVIDENCE_PARAM_PREFIX: N      = "evidence$"
    val EXCEPTION_RESULT_PREFIX: N    = "exceptionResult"
    val EXPAND_SEPARATOR: N           = "$$"
    val IMPL_CLASS_SUFFIX: N          = "$class"
    val IMPORT: N                     = "<import>"
    val INTERPRETER_IMPORT_WRAPPER: N = "$iw"
    val INTERPRETER_LINE_PREFIX: N    = "line"
    val INTERPRETER_VAR_PREFIX: N     = "res"
    val INTERPRETER_WRAPPER_SUFFIX: N = "$object"
    val LOCALDUMMY_PREFIX: N          = "<local "       // owner of local blocks
    val MODULE_SUFFIX: N              = NameTransformer.MODULE_SUFFIX_STRING
    val AVOID_CLASH_SUFFIX: N         = "$_avoid_name_clash_$"
    val MODULE_VAR_SUFFIX: N          = "$module"
    val NAME_JOIN: N                  = NameTransformer.NAME_JOIN_STRING
    val USCORE_PARAM_PREFIX: N        = "_$"
    val OPS_PACKAGE: N                = "<special-ops>"
    val OVERLOADED: N                 = "<overloaded>"
    val PACKAGE: N                    = "package"
    val PACKAGE_CLS: N                = "package$"
    val PROTECTED_PREFIX: N           = "protected$"
    val PROTECTED_SET_PREFIX: N       = PROTECTED_PREFIX + "set"
    val ROOT: N                       = "<root>"
    val SHADOWED: N                   = "(shadowed)"  // tag to be used until we have proper name kinds
    val SINGLETON_SUFFIX: N           = ".type"
    val SPECIALIZED_SUFFIX: N         = "$sp"
    val SUPER_PREFIX: N               = "super$"
    val WHILE_PREFIX: N               = "while$"
    val DEFAULT_EXCEPTION_NAME: N     = "ex$"
    val INITIALIZER_PREFIX: N         = "initial$"
    val COMPANION_MODULE_METHOD: N    = "companion$module"
    val COMPANION_CLASS_METHOD: N     = "companion$class"

    // value types (and AnyRef) are all used as terms as well
    // as (at least) arguments to the @specialize annotation.
    final val Boolean: N = "Boolean"
{'fraction_non_alphanumeric': 0.11504350029563308, 'fraction_numerical': 0.0, 'mean_word_length': 2.1414168214380473, 'pattern_counts': {'":': 2, '<': 25, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6258342', 'n_tokens_mistral': 3911, 'n_tokens_neox': 3831, 'n_words': 1153}