summaryrefslogblamecommitdiff
path: root/test/files/run/showraw_aliases.scala
blob: 56bd13707d664729b0e3371dc25e769c6945edf4 (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                             
                                
 



                                                                             

                                                     
import scala.reflect.runtime.universe._
import scala.tools.reflect.ToolBox

object Test extends App {
  val tb = runtimeMirror(getClass.getClassLoader).mkToolBox()
  val tree = tb.parse("""
    import scala.reflect.runtime.{universe => ru}
    ru
  """)
  val ttree = tb.typecheck(tree)

  def stabilizeIds(s: String) = """#\d+""".r.replaceAllIn(s, "#<id>")
  def stabilizePositions(s: String) = """\d+""".r.replaceAllIn(s, "<offset>")
  def stabilize(s: String) = stabilizePositions(stabilizeIds(s))
  println(stabilize(showRaw(ttree)))
  println(stabilize(showRaw(ttree, printIds = true)))
}