From b33babc2398e5013820e21568713fdb6c15aa6fa Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Fri, 5 Feb 2016 21:21:53 +0100 Subject: Do not use the plain printer with -Ydebug Instead, a new setting called -Yplain-printer is used for this. After this commit, we can now run all tests with -Ydebug (this was not the case before because using the plain printer breaks -Ytest-pickler) --- src/dotty/tools/dotc/config/ScalaSettings.scala | 1 + src/dotty/tools/dotc/printing/Printers.scala | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools') diff --git a/src/dotty/tools/dotc/config/ScalaSettings.scala b/src/dotty/tools/dotc/config/ScalaSettings.scala index b925ffa5a..035b20130 100644 --- a/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -151,6 +151,7 @@ class ScalaSettings extends Settings.SettingGroup { val Yheartbeat = BooleanSetting("-Yheartbeat", "show heartbeat stack trace of compiler operations.") val Yprintpos = BooleanSetting("-Yprintpos", "show tree positions.") val YnoDeepSubtypes = BooleanSetting("-Yno-deep-subtypes", "throw an exception on deep subtyping call stacks.") + val YplainPrinter = BooleanSetting("-Yplain-printer", "Pretty-print using a plain printer.") val YprintSyms = BooleanSetting("-Yprint-syms", "when printing trees print info in symbols instead of corresponding info in trees.") val YtestPickler = BooleanSetting("-Ytest-pickler", "self-test for pickling functionality; should be used with -Ystop-after:pickler") val YcheckReentrant = BooleanSetting("-Ycheck-reentrant", "check that compiled program does not contain vars that can be accessed from a global root.") diff --git a/src/dotty/tools/dotc/printing/Printers.scala b/src/dotty/tools/dotc/printing/Printers.scala index 7107ccb78..36043a4ff 100644 --- a/src/dotty/tools/dotc/printing/Printers.scala +++ b/src/dotty/tools/dotc/printing/Printers.scala @@ -8,7 +8,7 @@ trait Printers { this: Context => /** A function creating a printer */ def printer = { val pr = printerFn(this) - if (this.debug) pr.plain else pr + if (this.settings.YplainPrinter.value) pr.plain else pr } } -- cgit v1.2.3