diff options
author | Martin Odersky <odersky@gmail.com> | 2014-08-24 18:09:44 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-08-24 18:09:49 +0200 |
commit | 85d963d913e4fa7e608238e6853c77b02cf223e9 (patch) | |
tree | 68583c69fa8ee5aaceecb0d138368229e1df398d | |
parent | aa7a0399ad5424dd5292f2f1941c7293c16d6b79 (diff) | |
download | dotty-85d963d913e4fa7e608238e6853c77b02cf223e9.tar.gz dotty-85d963d913e4fa7e608238e6853c77b02cf223e9.tar.bz2 dotty-85d963d913e4fa7e608238e6853c77b02cf223e9.zip |
Clean up printing of flags and params
Print all flags if option -YDebugFlags is set.
Clean up printing of class type params.
-rw-r--r-- | src/dotty/tools/dotc/config/ScalaSettings.scala | 1 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Flags.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/printing/RefinedPrinter.scala | 15 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/config/ScalaSettings.scala b/src/dotty/tools/dotc/config/ScalaSettings.scala index af2e42b77..967a09543 100644 --- a/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -108,6 +108,7 @@ class ScalaSettings extends Settings.SettingGroup { val debug = BooleanSetting("-Ydebug", "Increase the quantity of debugging output.") val debugNames = BooleanSetting("-YdebugNames", "Show name-space indicators when printing names") val debugTrace = BooleanSetting("-YdebugTrace", "Trace core operations") + val debugFlags = BooleanSetting("-YdebugFlags", "Print all flags of definitions") //val doc = BooleanSetting ("-Ydoc", "Generate documentation") val termConflict = ChoiceSetting("-Yresolve-term-conflict", "strategy", "Resolve term conflicts", List("package", "object", "error"), "error") val inline = BooleanSetting("-Yinline", "Perform inlining when possible.") diff --git a/src/dotty/tools/dotc/core/Flags.scala b/src/dotty/tools/dotc/core/Flags.scala index 532f6d00f..3a03fdd28 100644 --- a/src/dotty/tools/dotc/core/Flags.scala +++ b/src/dotty/tools/dotc/core/Flags.scala @@ -431,7 +431,7 @@ object Flags { /** Flags guaranteed to be set upon symbol creation */ final val FromStartFlags = - AccessFlags | Module | Package | Deferred | MethodOrHKCommon | Param | Scala2ExistentialCommon | Touched | + AccessFlags | Module | Package | Deferred | MethodOrHKCommon | Param | ParamAccessor | Scala2ExistentialCommon | Touched | Static | CovariantCommon | ContravariantCommon | ExpandedName | AccessorOrSealed | CaseAccessorOrTypeArgument | Frozen | Erroneous | ImplicitCommon | Permanent | SelfNameOrImplClass diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala index d98c4f95e..e52038789 100644 --- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -484,15 +484,18 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { override protected def keyString(sym: Symbol): String = { val flags = sym.flagsUNSAFE - if (sym.isType && (flags is ExpandedTypeParam)) "" + if (sym.isType && sym.owner.isTerm) "" else super.keyString(sym) } - override def toTextFlags(sym: Symbol) = { - var flags = sym.flagsUNSAFE - if (flags is TypeParam) flags = flags &~ Protected - Text((flags & SourceModifierFlags).flagStrings map stringToText, " ") - } + override def toTextFlags(sym: Symbol) = + if (ctx.settings.debugFlags.value) + super.toTextFlags(sym) + else { + var flags = sym.flagsUNSAFE + if (flags is TypeParam) flags = flags &~ Protected + Text((flags & SourceModifierFlags).flagStrings map stringToText, " ") + } override def toText(denot: Denotation): Text = denot match { case denot: MultiDenotation => denot.toString |