From 3e45f134aaada49d720f15960f4b388d0c8ab193 Mon Sep 17 00:00:00 2001 From: ilyas Date: Tue, 10 Feb 2009 14:08:18 +0000 Subject: map page updated scalap flags adjusted according to man page --- src/Scala-lang.iml | 24 ------------- src/manual/scala/man1/scalap.scala | 6 ++-- src/scala-lang.iml | 40 ++++++++++++++++++++++ src/scalap/scala/tools/scalap/Main.scala | 6 ++-- src/scalap/scala/tools/scalap/Properties.scala | 4 +-- src/scalap/scala/tools/scalap/decoder.properties | 2 ++ .../scalax/rules/scalasig/ScalaSigPrinter.scala | 7 ++-- 7 files changed, 55 insertions(+), 34 deletions(-) delete mode 100644 src/Scala-lang.iml create mode 100644 src/scala-lang.iml create mode 100644 src/scalap/scala/tools/scalap/decoder.properties (limited to 'src') diff --git a/src/Scala-lang.iml b/src/Scala-lang.iml deleted file mode 100644 index 0d23d1a719..0000000000 --- a/src/Scala-lang.iml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/manual/scala/man1/scalap.scala b/src/manual/scala/man1/scalap.scala index 7d780ffdb8..465bc79037 100644 --- a/src/manual/scala/man1/scalap.scala +++ b/src/manual/scala/man1/scalap.scala @@ -18,7 +18,7 @@ object scalap extends Command { val synopsis = Section("SYNOPSIS", - CmdLine(" [ " & Argument("options") & " ] " & Argument("source file"))) + CmdLine(" [ " & Argument("options") & " ] " & Argument("class name"))) val parameters = Section("PARAMETERS", @@ -28,8 +28,8 @@ object scalap extends Command { "Command line options. See " & Link(Bold("OPTIONS"), "#options") & " below."), Definition( - Mono(Argument("source file")), - "One class file to be decoded (such as " & + Mono(Argument("class name")), + "Full-qualified name of a class to be decoded (such as " & Mono("hello.HelloWorld") & ")."))) val description = Section("DESCRIPTION", diff --git a/src/scala-lang.iml b/src/scala-lang.iml new file mode 100644 index 0000000000..365c7cd7f7 --- /dev/null +++ b/src/scala-lang.iml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 = "" @@ -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 } -- cgit v1.2.3