diff options
author | ilyas <ilyas@epfl.ch> | 2009-02-10 14:08:18 +0000 |
---|---|---|
committer | ilyas <ilyas@epfl.ch> | 2009-02-10 14:08:18 +0000 |
commit | 3e45f134aaada49d720f15960f4b388d0c8ab193 (patch) | |
tree | 0225658c4ddd7b1d1274cded4ccde02cd0b81901 /src/scalap | |
parent | ebb6a2a06a09a4c816a8531c9996c2f3df9aa5eb (diff) | |
download | scala-3e45f134aaada49d720f15960f4b388d0c8ab193.tar.gz scala-3e45f134aaada49d720f15960f4b388d0c8ab193.tar.bz2 scala-3e45f134aaada49d720f15960f4b388d0c8ab193.zip |
map page updated
scalap flags adjusted according to man page
Diffstat (limited to 'src/scalap')
4 files changed, 12 insertions, 7 deletions
diff --git a/src/scalap/scala/tools/scalap/Main.scala b/src/scalap/scala/tools/scalap/Main.scala index 6e91e00234..71b93835e6 100644 --- a/src/scalap/scala/tools/scalap/Main.scala +++ b/src/scalap/scala/tools/scalap/Main.scala @@ -22,11 +22,12 @@ object Main { val SCALA_SIG = "ScalaSig" val versionMsg = "Scala classfile decoder " + Properties.versionString + " -- " + - Properties.copyrightString + Properties.copyrightString + "\n" /**Verbose program run? */ var verbose = false + var printPrivates = false /**Prints usage information for scalap. */ @@ -74,7 +75,7 @@ object Main { case _ => } // Print classes - val printer = new ScalaSigPrinter(stream) + val printer = new ScalaSigPrinter(stream, printPrivates) for (c <- syms) { printer.printSymbol(c) } @@ -246,6 +247,7 @@ object Main { if (arguments contains "-help") usage verbose = arguments contains "-verbose" + printPrivates = arguments contains "-private" // construct a custom class path val classPath0 = new ClassPath(false) val path = arguments.getArgument("-classpath") match { diff --git a/src/scalap/scala/tools/scalap/Properties.scala b/src/scalap/scala/tools/scalap/Properties.scala index 1c23626aae..0be23d351d 100644 --- a/src/scalap/scala/tools/scalap/Properties.scala +++ b/src/scalap/scala/tools/scalap/Properties.scala @@ -15,7 +15,7 @@ package scala.tools.scalap object Properties { /** The name of the properties file */ - private val propFilename = "/decoder.properties" + private val propFilename = "decoder.properties" /** The loaded properties */ private val props = { @@ -35,7 +35,7 @@ object Properties { } val copyrightString: String = { - val defaultString = "(c) 2002-2006 LAMP/EPFL" + val defaultString = "(c) 2002-2009 LAMP/EPFL" props.getProperty("copyright.string", defaultString) } diff --git a/src/scalap/scala/tools/scalap/decoder.properties b/src/scalap/scala/tools/scalap/decoder.properties new file mode 100644 index 0000000000..2aeb55400c --- /dev/null +++ b/src/scalap/scala/tools/scalap/decoder.properties @@ -0,0 +1,2 @@ +version.number=2.0.1 +copyright.string=(c) 2002-2009 LAMP/EPFL diff --git a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala index abdb28e1f7..94a15b1c85 100644 --- a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala +++ b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala @@ -5,7 +5,7 @@ import java.io.{PrintStream, ByteArrayOutputStream} import util.StringUtil import java.util.regex.Pattern -class ScalaSigPrinter(stream: PrintStream) { +class ScalaSigPrinter(stream: PrintStream, printPrivates: Boolean) { import stream._ val CONSTRUCTOR_NAME = "<init>" @@ -15,7 +15,8 @@ class ScalaSigPrinter(stream: PrintStream) { def printSymbol(symbol: Symbol) {printSymbol(0, symbol)} def printSymbol(level: Int, symbol: Symbol) { - if (!symbol.isLocal) { + if (!symbol.isLocal && + !(symbol.isPrivate && !printPrivates)) { def indent() {for (i <- 1 to level) print(" ")} symbol match { @@ -104,7 +105,7 @@ class ScalaSigPrinter(stream: PrintStream) { case Some(m: MethodSymbol) => { val baos = new ByteArrayOutputStream val stream = new PrintStream(baos) - val printer = new ScalaSigPrinter(stream) + val printer = new ScalaSigPrinter(stream, printPrivates) printer.printMethodType(m.infoType, false) baos.toString } |