@@ -28,8 +28,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
28
28
private [this ] var myCtx : Context = _ctx
29
29
private [this ] var printPos = ctx.settings.YprintPos .value
30
30
private [this ] val printLines = ctx.settings.printLines.value
31
- private [this ] val YprintUser =
32
- ctx.settings.YprintUser .value && ! ctx.phases.dropWhile(! _.isInstanceOf [FirstTransform ]).contains(ctx.phase)
31
+ private [this ] val YprintDecompile =
32
+ ctx.settings.YprintDecompile .value && ! ctx.phases.dropWhile(! _.isInstanceOf [FirstTransform ]).contains(ctx.phase)
33
33
override protected [this ] implicit def ctx : Context = myCtx
34
34
35
35
def withEnclosingDef (enclDef : Tree [_ >: Untyped ])(op : => Text ): Text = {
@@ -282,7 +282,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
282
282
val flags = mods.flags & flagMask
283
283
val flagsText = if (flags.isEmpty) " " else keywordStr((mods.flags & flagMask).toString)
284
284
val annotations =
285
- if (YprintUser ) mods.annotations.filter(_.tpe != defn.SourceFileAnnotType )
285
+ if (YprintDecompile ) mods.annotations.filter(_.tpe != defn.SourceFileAnnotType )
286
286
else mods.annotations
287
287
Text (annotations.map(annotText), " " ) ~~ flagsText ~~ (Str (kw) provided ! suppressKw)
288
288
}
@@ -428,7 +428,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
428
428
}
429
429
case Closure (env, ref, target) =>
430
430
(" closure(" ~ (toTextGlobal(env, " , " ) ~ " | " provided env.nonEmpty) ~
431
- toTextGlobal(ref) ~ (" :" ~ toText(target) provided ! target.isEmpty) ~ " )" ).provided(! YprintUser )
431
+ toTextGlobal(ref) ~ (" :" ~ toText(target) provided ! target.isEmpty) ~ " )" ).provided(! YprintDecompile )
432
432
case Match (sel, cases) =>
433
433
if (sel.isEmpty) blockText(cases)
434
434
else changePrec(GlobalPrec ) { toText(sel) ~ keywordStr(" match " ) ~ blockText(cases) }
@@ -489,10 +489,10 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
489
489
modText(tree.mods, keywordStr(if (tree.mods is Mutable ) " var" else " val" )) ~~
490
490
valDefText(nameIdText(tree)) ~ optAscription(tpt) ~
491
491
withEnclosingDef(tree) { optText(tree.rhs)(" = " ~ _) }
492
- }.provided(! YprintUser || ! tree.symbol.is(Module ))
492
+ }.provided(! YprintDecompile || ! tree.symbol.is(Module ))
493
493
case tree @ DefDef (name, tparams, vparamss, tpt, _) =>
494
494
dclTextOr {
495
- val printLambda = tree.symbol.isAnonymousFunction && YprintUser
495
+ val printLambda = tree.symbol.isAnonymousFunction && YprintDecompile
496
496
val prefix = modText(tree.mods, keywordStr(" def" )) ~~ valDefText(nameIdText(tree)) provided (! printLambda)
497
497
withEnclosingDef(tree) {
498
498
addVparamssText(prefix ~ tparamsText(tparams), vparamss) ~ optAscription(tpt).provided(! printLambda) ~
@@ -508,7 +508,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
508
508
def recur (rhs : Tree , tparamsTxt : => Text ): Text = rhs match {
509
509
case impl : Template =>
510
510
val decl =
511
- if (! YprintUser || ! tree.mods.is(Module )) modText(tree.mods, keywordStr(if ((tree).mods is Trait ) " trait" else " class" ))
511
+ if (! YprintDecompile || ! tree.mods.is(Module )) modText(tree.mods, keywordStr(if ((tree).mods is Trait ) " trait" else " class" ))
512
512
else modText(tree.mods &~ (Final | Module ), keywordStr(" object" ))
513
513
decl ~~ typeText(nameIdText(tree)) ~ withEnclosingDef(tree) { toTextTemplate(impl) } ~
514
514
(if (tree.hasType && ctx.settings.verbose.value) i " [decls = ${tree.symbol.info.decls}] " else " " )
0 commit comments