<commit_before>// Author: <NAME> (http://ochafik.com)
// Feel free to modify and reuse this for any purpose ("public domain / I don't care").
package scalaxy.extensions

//import scala.reflect.api.Universe
import scala.tools.nsc.Global
import scala.reflect.internal.Flags

trait Extensions
{
  val global: Global
  import global._
  import definitions._

  def termPath(path: String): Tree = {
    termPath(path.split("\\.").toList)
  }
  def termPath(components: List[String]): Tree = {
    components.tail.foldLeft(Ident(components.head: TermName): Tree)((p, n) => Select(p, n: TermName))
  }
  
  def typePath(path: String): Tree = {
    val components = path.split("\\.")
    Select(termPath(components.dropRight(1).toList), components.last: TypeName)
  }
  
  def newImportAll(tpt: Tree, pos: Position): Import = {
    Import(
      tpt,
      List(
        ImportSelector("_": TermName, pos.point, null, -1)))
  }
  
  def newImportMacros(pos: Position): Import = {
    val macrosName: TermName = "macros"
    Import(
      termPath("scala.language.experimental"),
      List(
        ImportSelector(macrosName, pos.point, macrosName, -1)
      )
    )
  }
  
  def newEmptyTpt() = TypeTree(null)
  
  def genParamAccessorsAndConstructor(namesAndTypeTrees: List[(String, Tree)]): List[Tree] = {
    (
      namesAndTypeTrees.map { 
        case (name, tpt) =>
          ValDef(Modifiers(Flags.PARAMACCESSOR | Flag.PRIVATE | Flag.LOCAL), name, tpt, EmptyTree)
      }
    ) :+
    DefDef(
      NoMods,
      nme.CONSTRUCTOR,
      Nil,
      List(
        namesAndTypeTrees.map { case (name, tpt) =>
          ValDef(NoMods, name, tpt, EmptyTree)
        }
      ),
      newEmptyTpt(),
      newSuperInitConstructorBody()
    )
  }
  
  def newSelfValDef(): ValDef = {
    ValDef(Modifiers(Flag.PRIVATE), "_": TermName, newEmptyTpt(), EmptyTree)<commit_msg>extension: quick fix of regression<commit_after>// Author: <NAME> (http://ochafik.com)
// Feel free to modify and reuse this for any purpose ("public domain / I don't care").
package scalaxy.extensions

//import scala.reflect.api.Universe
import scala.tools.nsc.Global
import scala.reflect.internal.Flags

trait Extensions
{
  val global: Global
  import global._
  import definitions._

  def termPath(path: String): Tree = {
    termPath(path.split("\\.").toList)
  }
  def termPath(components: List[String]): Tree = {
    components.tail.foldLeft(Ident(components.head: TermName): Tree)((p, n) => Select(p, n: TermName))
  }
  
  def typePath(path: String): Tree = {
    val components = path.split("\\.")
    Select(termPath(components.dropRight(1).toList), components.last: TypeName)
  }
  
  def newImportAll(tpt: Tree, pos: Position): Import = {
    Import(
      tpt,
      List(
        ImportSelector("_": TermName, pos.point, null, -1)))
  }
  
  def newImportMacros(pos: Position): Import = {
    val macrosName: TermName = "macros"
    Import(
      termPath("scala.language.experimental"),
      List(
        ImportSelector(macrosName, pos.point, macrosName, -1)
      )
    )
  }
  
  def newEmptyTpt() = TypeTree(null)
  
  def genParamAccessorsAndConstructor(namesAndTypeTrees: List[(String, Tree)]): List[Tree] = {
    (
      namesAndTypeTrees.map { 
        case (name, tpt) =>
          ValDef(Modifiers(Flags.PARAMACCESSOR), name, tpt, EmptyTree)
      }
    ) :+
    DefDef(
      NoMods,
      nme.CONSTRUCTOR,
      Nil,
      List(
        namesAndTypeTrees.map { case (name, tpt) =>
          ValDef(NoMods, name, tpt, EmptyTree)
        }
      ),
      newEmptyTpt(),
      newSuperInitConstructorBody()
    )
  }
  
  def newSelfValDef(): ValDef = {
    ValDef(Modifiers(Flag.PRIVATE), "_": TermName, newEmptyTpt(), EmptyTree)
{'fraction_non_alphanumeric': 0.13571620532115022, 'fraction_numerical': 0.0016124697661918839, 'mean_word_length': 2.9137749737118823, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 11, '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': '937783', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1227, 'n_words': 263}