@@ -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 = {
@@ -276,7 +276,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
276
276
val flags = mods.flags & flagMask
277
277
val flagsText = if (flags.isEmpty) " " else keywordStr((mods.flags & flagMask).toString)
278
278
val annotations =
279
- if (YprintUser ) mods.annotations.filter(_.tpe != defn.SourceFileAnnotType )
279
+ if (YprintDecompile ) mods.annotations.filter(_.tpe != defn.SourceFileAnnotType )
280
280
else mods.annotations
281
281
Text (annotations.map(annotText), " " ) ~~ flagsText ~~ (Str (kw) provided ! suppressKw)
282
282
}
@@ -422,7 +422,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
422
422
}
423
423
case Closure (env, ref, target) =>
424
424
(" closure(" ~ (toTextGlobal(env, " , " ) ~ " | " provided env.nonEmpty) ~
425
- toTextGlobal(ref) ~ (" :" ~ toText(target) provided ! target.isEmpty) ~ " )" ).provided(! YprintUser )
425
+ toTextGlobal(ref) ~ (" :" ~ toText(target) provided ! target.isEmpty) ~ " )" ).provided(! YprintDecompile )
426
426
case Match (sel, cases) =>
427
427
if (sel.isEmpty) blockText(cases)
428
428
else changePrec(GlobalPrec ) { toText(sel) ~ keywordStr(" match " ) ~ blockText(cases) }
@@ -483,10 +483,10 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
483
483
modText(tree.mods, keywordStr(if (tree.mods is Mutable ) " var" else " val" )) ~~
484
484
valDefText(nameIdText(tree)) ~ optAscription(tpt) ~
485
485
withEnclosingDef(tree) { optText(tree.rhs)(" = " ~ _) }
486
- }.provided(! YprintUser || ! tree.symbol.is(Module ))
486
+ }.provided(! YprintDecompile || ! tree.symbol.is(Module ))
487
487
case tree @ DefDef (name, tparams, vparamss, tpt, _) =>
488
488
dclTextOr {
489
- val printLambda = tree.symbol.isAnonymousFunction && YprintUser
489
+ val printLambda = tree.symbol.isAnonymousFunction && YprintDecompile
490
490
val prefix = modText(tree.mods, keywordStr(" def" )) ~~ valDefText(nameIdText(tree)) provided (! printLambda)
491
491
withEnclosingDef(tree) {
492
492
addVparamssText(prefix ~ tparamsText(tparams), vparamss) ~ optAscription(tpt).provided(! printLambda) ~
@@ -502,7 +502,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
502
502
def recur (rhs : Tree , tparamsTxt : => Text ): Text = rhs match {
503
503
case impl : Template =>
504
504
val decl =
505
- if (! YprintUser || ! tree.mods.is(Module )) modText(tree.mods, keywordStr(if ((tree).mods is Trait ) " trait" else " class" ))
505
+ if (! YprintDecompile || ! tree.mods.is(Module )) modText(tree.mods, keywordStr(if ((tree).mods is Trait ) " trait" else " class" ))
506
506
else modText(tree.mods &~ (Final | Module ), keywordStr(" object" ))
507
507
decl ~~ typeText(nameIdText(tree)) ~ withEnclosingDef(tree) { toTextTemplate(impl) } ~
508
508
(if (tree.hasType && ctx.settings.verbose.value) i " [decls = ${tree.symbol.info.decls}] " else " " )
0 commit comments