summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/util/ShowPickled.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-11-11 05:21:37 +0000
committerPaul Phillips <paulp@improving.org>2010-11-11 05:21:37 +0000
commit19064bad63aff0d3386bf7d5fb154b14c345c418 (patch)
treeea794f756a9df3b2928d48bebafb650912ae60cb /src/compiler/scala/tools/nsc/util/ShowPickled.scala
parentb95246f152347fad32630ad7dc251750b3c4ae47 (diff)
downloadscala-19064bad63aff0d3386bf7d5fb154b14c345c418.tar.gz
scala-19064bad63aff0d3386bf7d5fb154b14c345c418.tar.bz2
scala-19064bad63aff0d3386bf7d5fb154b14c345c418.zip
Some more work on options related to showing co...
Some more work on options related to showing compiler structures during compilation. The pickler knew more than was healthy about things like compiler settings, so I let the pickler worry about pickling and moved that logic somewhere closer to the surface. Some convenience oriented tweaks to command line phase parsing. The end result is as follows (some output trimmed for brevity.) // dippy.scala class Dippy { def f[T <: Dippy](x: T) = (x, x) object DingusDippy extends util.Random { } } // className@phaseString should be reliably unambiguous % scalac -Xshow-class Dippy@typer,erasure,jvm dippy.scala <<-- class Dippy after phase 'typer' -->> Members (excluding Any/AnyRef unless overridden): final object DingusDippy extends object Dippy.this.DingusDippy def f[T <: Dippy](x: T): (T, T) <<-- class Dippy after phase 'erasure' -->> Members (excluding Any/AnyRef unless overridden): private lazy var DingusDippy$module: object Dippy#DingusDippy lazy val DingusDippy(): object Dippy#DingusDippy def f(x: Dippy): Tuple2 <<-- class Dippy after phase 'jvm' -->> Members (excluding Any/AnyRef unless overridden): protected var bitmap$0: Int private lazy var DingusDippy$module: object Dippy$DingusDippy lazy val DingusDippy(): object Dippy$DingusDippy def f(x: Dippy): Tuple2 No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/util/ShowPickled.scala')
-rw-r--r--src/compiler/scala/tools/nsc/util/ShowPickled.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/util/ShowPickled.scala b/src/compiler/scala/tools/nsc/util/ShowPickled.scala
index 458116845d..58abd721c5 100644
--- a/src/compiler/scala/tools/nsc/util/ShowPickled.scala
+++ b/src/compiler/scala/tools/nsc/util/ShowPickled.scala
@@ -284,8 +284,11 @@ object ShowPickled extends Names {
catch { case _: Exception => None }
def show(what: String, pickle: PickleBuffer, bare: Boolean) = {
- Console.println(what + ": ")
+ Console.println(what)
+ val saved = pickle.readIndex
+ pickle.readIndex = 0
printFile(pickle, Console.out, bare)
+ pickle.readIndex = saved
}
private lazy val ShowPickledSpec =
@@ -304,7 +307,7 @@ object ShowPickled extends Names {
residualArgs foreach { arg =>
(fromFile(arg) orElse fromName(arg)) match {
- case Some(pb) => show(arg, pb, parsed isSet "--bare")
+ case Some(pb) => show(arg + ":", pb, parsed isSet "--bare")
case _ => Console.println("Cannot read " + arg)
}
}