File tree Expand file tree Collapse file tree 1 file changed +1
-19
lines changed
compiler/src/dotty/tools/dotc/quoted Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Original file line number Diff line number Diff line change 11package dotty .tools .dotc .quoted
22
33import dotty .tools .dotc .ast .tpd
4- import dotty .tools .dotc .core .Contexts .Context
5- import dotty .tools .dotc .core .Constants ._
6- import dotty .tools .dotc .core .quoted .PickledQuotes
7- import dotty .tools .dotc .printing .RefinedPrinter
84
95import scala .quoted .Expr
10- import scala .runtime .BoxedUnit
116import scala .quoted .Exprs .{LiftedExpr , TastyTreeExpr }
127import scala .runtime .quoted ._
138
@@ -32,20 +27,7 @@ object Toolbox {
3227 new QuoteDriver ().run(expr, runSettings)
3328 }
3429
35- def show (expr : Expr [T ]): String = expr match {
36- case expr : LiftedExpr [T ] =>
37- expr.value match {
38- case value : Class [_] => s " classOf[ ${value.getCanonicalName}] "
39- case value if value == BoxedUnit .UNIT => " ()"
40- case value =>
41- implicit val ctx = new QuoteDriver ().initCtx
42- if (showSettings.compilerArgs.contains(" -color:never" ))
43- ctx.settings.color.update(" never" )
44- val printer = new RefinedPrinter (ctx)
45- printer.toText(Literal (Constant (value))).mkString(Int .MaxValue , false )
46- }
47- case _ => new QuoteDriver ().show(expr, showSettings)
48- }
30+ def show (expr : Expr [T ]): String = new QuoteDriver ().show(expr, showSettings)
4931
5032 }
5133
You can’t perform that action at this time.
0 commit comments