diff options
author | michelou <michelou@epfl.ch> | 2011-09-25 17:06:54 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2011-09-25 17:06:54 +0000 |
commit | 5d5826812ae66b748342d86c5185e9bf7612fe7f (patch) | |
tree | d7d41146c5391c6963b50668d872ddb82b14d8e4 /src | |
parent | 3e24f4c48d39681b948836f70f58a84f02fb76e2 (diff) | |
download | scala-5d5826812ae66b748342d86c5185e9bf7612fe7f.tar.gz scala-5d5826812ae66b748342d86c5185e9bf7612fe7f.tar.bz2 scala-5d5826812ae66b748342d86c5185e9bf7612fe7f.zip |
updated man pages, fixed svn props, did some cl...
updated man pages, fixed svn props, did some cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/ant/antlib.xml | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/plugins/PluginDescription.scala | 62 | ||||
-rw-r--r-- | src/compiler/scala/tools/util/XML.scala | 147 | ||||
-rw-r--r--[-rwxr-xr-x] | src/library/scala/AnyVal.scala | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/library/scala/Boolean.scala | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/library/scala/Unit.scala | 0 | ||||
-rw-r--r-- | src/manual/scala/man1/Command.scala | 12 | ||||
-rw-r--r-- | src/manual/scala/man1/fsc.scala | 11 | ||||
-rw-r--r-- | src/manual/scala/man1/sbaz.scala | 10 | ||||
-rw-r--r-- | src/manual/scala/man1/scala.scala | 24 | ||||
-rw-r--r-- | src/manual/scala/man1/scalac.scala | 226 | ||||
-rw-r--r-- | src/manual/scala/man1/scaladoc.scala | 9 | ||||
-rw-r--r-- | src/manual/scala/man1/scalap.scala | 8 |
13 files changed, 404 insertions, 107 deletions
diff --git a/src/compiler/scala/tools/ant/antlib.xml b/src/compiler/scala/tools/ant/antlib.xml index bbdf1fc9db..4a186d3cf4 100644 --- a/src/compiler/scala/tools/ant/antlib.xml +++ b/src/compiler/scala/tools/ant/antlib.xml @@ -11,8 +11,10 @@ classname="scala.tools.ant.ScalaTool"/> <taskdef name="sbaz" classname="scala.tools.ant.ScalaBazaar"/> + <!--@XML--> <taskdef name="scaladoc" classname="scala.tools.ant.Scaladoc"/> + <!--XML@--> <taskdef name="scalatool" classname="scala.tools.ant.ScalaTool"/> <taskdef name="same" diff --git a/src/compiler/scala/tools/nsc/plugins/PluginDescription.scala b/src/compiler/scala/tools/nsc/plugins/PluginDescription.scala index a3e6a844ba..703a2453eb 100644 --- a/src/compiler/scala/tools/nsc/plugins/PluginDescription.scala +++ b/src/compiler/scala/tools/nsc/plugins/PluginDescription.scala @@ -6,14 +6,18 @@ package scala.tools.nsc package plugins -import java.io.File - +/*@XML*/ import scala.xml.{Node,NodeSeq} +/*XML@*/ +/*@NOXML +import org.w3c.dom.{Node, Document, Text} +import scala.tools.util.XML +XMLNO@*/ /** A description of a compiler plugin, suitable for serialization * to XML for inclusion in the plugin's .jar file. * - * @author Lex Spoon + * @author Lex Spoon, Stephane Micheloud * @version 1.0, 2007-5-21 */ abstract class PluginDescription { @@ -29,31 +33,74 @@ abstract class PluginDescription { /** An XML representation of this description. It can be * read back using <code>PluginDescription.fromXML</code>. - * It should be stored inside the jar. + * It should be stored inside the jar archive file. */ +/*@XML*/ // NB. This code DOES rely on Scala native XML support. def toXML: Node = { <plugin> <name>{name}</name> <classname>{classname}</classname> </plugin> } -} +/*XML@*/ +/*@NOXML // NB. This code DOES NOT rely on Scala native XML support. + def toXML: Node = pluginDoc + + private lazy val pluginDoc: Node = { + val root = XML.newDocument() + val pluginElem = root createElement "plugin" + root appendChild pluginElem + + val nameElem = root createElement "name" + nameElem appendChild (root createTextNode name) + pluginElem appendChild nameElem + + val classnameElem = root createElement "classname" + classnameElem appendChild (root createTextNode classname) + pluginElem appendChild classnameElem + + root + } +XMLNO@*/ +} /** Utilities for the PluginDescription class. * - * @author Lex Spoon + * @author Lex Spoon, Stephane Micheloud * @version 1.0, 2007-5-21 */ object PluginDescription { + def fromXML(xml: Node): Option[PluginDescription] = { // check the top-level tag +/*@XML*/ xml match { case <plugin>{_*}</plugin> => () case _ => return None } +/*XML@*/ +/*@NOXML + val node = xml match { + case root: Document => root.getDocumentElement + case node => node + } + if (node.getNodeName != "plugin") + return None - /** Extract one field */ + class RichNode(node: Node) { + def \\(tagName: String): Node = node match { + case root: Document => root.getElementsByTagName(tagName) item 0 + case _ => node //TODO: visit children + } + def text: String = node match { + case t: Text => t.getWholeText + case e => e.getTextContent + } + } + implicit def nodeWrapper(node: Node) = new RichNode(node) +XMLNO@*/ + // extract one field def getField(field: String): Option[String] = { val text = (xml \\ field).text.trim if (text == "") None else Some(text) @@ -74,4 +121,5 @@ object PluginDescription { val classname = classname1 }) } + } diff --git a/src/compiler/scala/tools/util/XML.scala b/src/compiler/scala/tools/util/XML.scala new file mode 100644 index 0000000000..d83a33fba9 --- /dev/null +++ b/src/compiler/scala/tools/util/XML.scala @@ -0,0 +1,147 @@ +/* NSC -- new Scala compiler + * Copyright 2005-2011 LAMP/EPFL + * @author Stephane Micheloud + */ + +package scala.tools +package util + +/** The object `XML` provides minimal XML support for creating, loading + * and saving XML documents (see eg. [[scala.tools.ant.ScalaBazaar]], + * [[scala.tools.nsc.plugins.PluginDescription]] and + * [[scala.tools.partest.PartestTask]]). + * + * It makes possible for the programmer of Scala tools not to rely on the + * XML features of the reference implementation of the Scala compiler + * (some Scala customers may for instance not be interested in that features). + * + * @author Stephane Micheloud + * @version 1.0 + */ +/*@NOXML +// [mics] used in code which DOES NOT rely on Scala native XML support +// (see eg. classes partest/PartestTask.scala, ant/ScalaBazaar.scala). +object XML { + import java.io.{FileOutputStream, InputStream, Writer} + import java.nio.channels.Channels + import javax.xml.parsers.DocumentBuilderFactory + import org.w3c.dom.{Document, DocumentType, Element, NamedNodeMap} + import org.w3c.dom.{Node => JNode, Text => JText} + import org.xml.sax.InputSource + import scala.util.control.Exception.ultimately + + def newDocument(): Document = newBuilder.newDocument() + + def loadXML(source: InputSource): Document = newBuilder parse source + + def load(in: InputStream) = loadXML(new InputSource(in)) + + final def save(filename: String, node: Node, + encoding: String = "ISO-8859-1", + xmlDecl: Boolean = false, + doctype: DocumentType = null) { + val fos = new FileOutputStream(filename) + val w = Channels.newWriter(fos.getChannel, encoding) + + ultimately(w.close()) { + write(w, node, encoding, xmlDecl, doctype) + } + } + + final def write(out: Writer, node: Node, encoding: String, xmlDecl: Boolean, doctype: DocumentType) { + if (xmlDecl) out.write("<?xml version='1.0' encoding='" + encoding + "'?>\n") + if (doctype ne null) out.write(doctype.getName + "\n") + out write node.toXMLString + } + + class Node(val node: JNode) { + def toXMLString: String = { + var indent: Int = 0 + val sb = new StringBuilder() + def xmlTag(s: String, attrs: NamedNodeMap, trail: String) { + var i = 0; while (i < indent) { sb append spaces; i += 1 } + sb append "<" append s + for (i <- 0 until attrs.getLength) { + val attr = attrs item i + sb append " " append attr.getNodeName append "=\"" append attr.getTextContent append "\"" + } + sb append trail + } + def startTag(s: String, attrs: NamedNodeMap) { + xmlTag(s, attrs, Node.TAG_TRAIL_EOL) + indent += 1 + } + def startTag1(s: String, attrs: NamedNodeMap) { + xmlTag(s, attrs, Node.TAG_TRAIL) + } + def shortTag(s: String, attrs: NamedNodeMap) { + xmlTag(s, attrs, Node.STAG_TRAIL_EOL) + } + def endTag(s: String) { + indent -= 1 + var i = 0; while (i < indent) { sb append spaces; i += 1 } + sb append "</" append s append Node.TAG_TRAIL_EOL + } + def endTag1(s: String) { + sb append "</" append s append Node.TAG_TRAIL_EOL + } + def traverse(node: JNode) { + val name = node.getNodeName + val attrs = node.getAttributes + var children = node.getChildNodes + val n = children.getLength + if (n == 1 && children.item(0).isInstanceOf[JText]) { + startTag1(name, attrs) + sb append children.item(0).asInstanceOf[JText].getWholeText + endTag1(name) + } + else if (n > 0) { + startTag(name, attrs) + for (i <- 0 until n) { + mkString(children item i) + } + endTag(name) + } + else + shortTag(name, attrs) + } + def mkString(node: JNode) = node match { + case t: JText => sb append t.getWholeText + case e => traverse(e) + } + traverse(node match { + case docu: Document => docu.getDocumentElement + case elem => elem + }) + sb.toString + } + + def text: String = node match { + case t: JText => t.getWholeText + case n => n.getTextContent + } + + override def toString: String = toXMLString + } + + implicit def nodeWrapper(node: JNode) = new Node(node) + + // ---------- private declarations -------- + + private val docFactory = DocumentBuilderFactory.newInstance() + docFactory setNamespaceAware false + private def newBuilder = docFactory.newDocumentBuilder() + + private var spaces = " " + def spaces_=(n: Int) { spaces = List.fill(n)(' ').mkString } + + private object Node { + final val TAG_TRAIL = ">" + final val TAG_TRAIL_EOL = TAG_TRAIL+compat.Platform.EOL + final val STAG_TRAIL = "/>" + final val STAG_TRAIL_EOL = STAG_TRAIL+compat.Platform.EOL + } + +} +XMLNO@*/ + diff --git a/src/library/scala/AnyVal.scala b/src/library/scala/AnyVal.scala index cd2c04dbd8..cd2c04dbd8 100755..100644 --- a/src/library/scala/AnyVal.scala +++ b/src/library/scala/AnyVal.scala diff --git a/src/library/scala/Boolean.scala b/src/library/scala/Boolean.scala index 0adcde3aba..0adcde3aba 100755..100644 --- a/src/library/scala/Boolean.scala +++ b/src/library/scala/Boolean.scala diff --git a/src/library/scala/Unit.scala b/src/library/scala/Unit.scala index 57970b021b..57970b021b 100755..100644 --- a/src/library/scala/Unit.scala +++ b/src/library/scala/Unit.scala diff --git a/src/manual/scala/man1/Command.scala b/src/manual/scala/man1/Command.scala index 01b0750c01..16c4307140 100644 --- a/src/manual/scala/man1/Command.scala +++ b/src/manual/scala/man1/Command.scala @@ -5,6 +5,10 @@ package scala.man1 +/** + * @author Stephane Micheloud + * @version 1.0 + */ trait Command { import _root_.scala.tools.docutil.ManPage._ @@ -23,6 +27,9 @@ trait Command { protected def CmdOption(opt: String): AbstractText = Mono(Bold(NDash & opt) & " ") + protected def CmdOptionBound(opt: String, params: AbstractText) = + Mono(Bold(NDash & opt) & params & " ") + protected def CmdOptionLong(opt: String, params: AbstractText) = Mono(Bold(NDash & NDash & opt) & " " & params & " ") @@ -48,10 +55,5 @@ trait Command { "Report bugs to " & Mono("https://issues.scala-lang.org/") & ".") - //private val df = new java.text.SimpleDateFormat("MMM d, yyyy") - //private val rightNow = new java.util.Date() - - def lastModified: String = "April 18, 2007" // df.format(rightNow) - def manpage: Document } diff --git a/src/manual/scala/man1/fsc.scala b/src/manual/scala/man1/fsc.scala index 03ca391648..1f82cdf0ce 100644 --- a/src/manual/scala/man1/fsc.scala +++ b/src/manual/scala/man1/fsc.scala @@ -5,11 +5,14 @@ package scala.man1 +/** + * @author Lex Spoon + * @version 1.0 + */ object fsc extends Command { import _root_.scala.tools.docutil.ManPage._ protected def cn = new Error().getStackTrace()(0).getClassName() - override def lastModified = "January 18, 2007" val name = Section("NAME", @@ -63,8 +66,8 @@ object fsc extends Command { "is not needed. Note that the hostname must be for a host that shares " & "the same filesystem."), Definition( - CmdOption("J", Argument("flag")), - "Pass <flag> directly to the Java VM for the compilation daemon.") + CmdOptionBound("J", Argument("flag")), + "Pass " & Mono(Argument("flag")) & " directly to the Java VM for the compilation daemon.") )) val example = Section("EXAMPLE", @@ -146,7 +149,7 @@ object fsc extends Command { def manpage = new Document { title = command - date = lastModified + date = "January 2007" author = "Lex Spoon" version = "0.4" sections = List( diff --git a/src/manual/scala/man1/sbaz.scala b/src/manual/scala/man1/sbaz.scala index a9c65fa3f0..2e12330408 100644 --- a/src/manual/scala/man1/sbaz.scala +++ b/src/manual/scala/man1/sbaz.scala @@ -5,6 +5,10 @@ package scala.man1 +/** + * @author Stephane Micheloud + * @version 1.0 + */ object sbaz extends Command { import _root_.scala.tools.docutil.ManPage._ @@ -63,13 +67,13 @@ object sbaz extends Command { "Display the version information"), Definition( - CmdOption("-univ") & Argument("name"), + CmdOptionLong("univ", Argument("name")), "Operate on the named remote universe, selected from those " & "in the local managed directory's universe. Affects "& "the "&MBold("share")&" and "&MBold("retract")&" commands."), Definition( - CmdOption("-univ-url") & Argument("url"), + CmdOptionLong("univ-url", Argument("url")), "Operate on the universe at the specified URL. Affects "& "the "&MBold("share")&" and "&MBold("retract")&" commands."))), @@ -186,7 +190,7 @@ object sbaz extends Command { def manpage = new Document { title = command - date = "August 24, 2006" + date = "August 2006" author = "Stephane Micheloud" version = "0.3" sections = List( diff --git a/src/manual/scala/man1/scala.scala b/src/manual/scala/man1/scala.scala index e1084e4852..368453f3a9 100644 --- a/src/manual/scala/man1/scala.scala +++ b/src/manual/scala/man1/scala.scala @@ -5,6 +5,10 @@ package scala.man1 +/** + * @author Stephane Micheloud + * @version 1.0 + */ object scala extends Command { import _root_.scala.tools.docutil.ManPage._ @@ -32,23 +36,23 @@ object scala extends Command { Link(Bold("scalac") & "(1)", "scalac.html") & "."), Definition( - Mono("-howtorun:") & Argument("how"), + CmdOptionBound("howtorun:", Argument("how")), "How to execute " & Argument("torun") & ", if it is present. " & "Options for " & Argument("how") & " are " & Mono("guess") & " (the default), " & Mono("script") & ", and " & Mono("object") & "."), Definition( - Mono("-i"), + CmdOption("i"), "Requests that a file be pre-loaded. It is only " & "meaningful for interactive shells."), Definition( - Mono("-e"), + CmdOption("e"), "Requests that its argument be executed as Scala code."), Definition( - Mono("-savecompiled"), + CmdOption("savecompiled"), "Save this compiled version of scripts in order to speed up " & "later executions of the same script. When running a script, " & "save the compiled version of in a file with the same name as the " & @@ -57,11 +61,11 @@ object scala extends Command { "will be used if it is newer than the script file."), Definition( - Mono("-nocompdaemon"), - "Do not use the " & Bold("fsc") & " offline compiler."), + CmdOption("nocompdaemon"), + "Do not use the " & MBold("fsc") & " offline compiler."), Definition( - Mono("-D") & Argument("property=value"), + CmdOptionBound("D", "property=value"), "Set a Java system property. If no value is specified, " & "then the property is set to the empty string."), @@ -75,8 +79,8 @@ object scala extends Command { val description = Section("DESCRIPTION", - "The "&MBold(command)&" utility runs Scala code using a Java runtime "& - "environment. The Scala code to run is " & + "The " & MBold(command) & " utility runs Scala code using a Java " & + "runtime environment. The Scala code to run is " & "specified in one of three ways:", NumberedList( @@ -253,7 +257,7 @@ object scala extends Command { def manpage = new Document { title = command - date = lastModified + date = "April 2007" author = "Stephane Micheloud" version = "0.5" sections = List( diff --git a/src/manual/scala/man1/scalac.scala b/src/manual/scala/man1/scalac.scala index f305679881..b84510ee16 100644 --- a/src/manual/scala/man1/scalac.scala +++ b/src/manual/scala/man1/scalac.scala @@ -7,6 +7,7 @@ package scala.man1 /** * @author Stephane Micheloud + * @version 1.0 */ object scalac extends Command { import _root_.scala.tools.docutil.ManPage._ @@ -51,41 +52,26 @@ object scalac extends Command { "current development environment and will be supported in future " & "releases. An additional set of non-standard options are specific to " & "the current virtual machine implementation and are subject to change " & - "in the future. Non-standard options begin with " & Bold("-X") & ".", + "in the future. Non-standard options begin with " & MBold("-X") & ".", Section("Standard Options", DefinitionList( Definition( - CmdOption("g:{none,source,line,vars,notc}"), - SeqPara( - Mono("\"none\"") & " generates no debugging info,", - Mono("\"source\"") & " generates only the source file attribute,", - Mono("\"line\"") & " generates source and line number information,", - Mono("\"vars\"") & " generates source, line number and local " & - "variable information,", - Mono("\"notc\"") & " generates all of the above and " & - Italic("will not") & " perform tail call optimization.")), + CmdOptionBound("D", "property=value"), + "Pass " & CmdOptionBound("D", "property=value") & " directly to the runtime system."), Definition( - CmdOption("nowarn"), - "Generate no warnings"), + CmdOptionBound("J", Argument("flag")), + "Pass " & Mono(Argument("flag")) & " directly to the runtime system."), Definition( - CmdOption("verbose"), - "Output messages about what the compiler is doing"), + CmdOptionBound("P:", Argument("plugin:opt")), + "Pass an option to a plugin"), Definition( - CmdOption("deprecation"), - SeqPara( - "Indicate whether source should be compiled with deprecation " & - "information; defaults to " & Mono("off") & " (" & - "accepted values are: " & Mono("on") & ", " & Mono("off") & - ", " & Mono("yes") & " and " & Mono("no") & ")", - "Available since Scala version 2.2.1")), + CmdOption("X"), + "Print a synopsis of advanced options."), Definition( - CmdOption("unchecked"), - SeqPara( - "Enable detailed unchecked warnings", - "Non variable type-arguments in type patterns are unchecked " & - "since they are eliminated by erasure", - "Available since Scala version 2.3.0")), + CmdOption("bootclasspath", Argument("path")), + "Override location of bootstrap class files (where to find the " & + "standard built-in classes, such as \"" & Mono("scala.List") & "\")."), Definition( CmdOption("classpath", Argument("path")), SeqPara( @@ -99,19 +85,14 @@ object scalac extends Command { "include the current directory in the search path, you must " & "include " & Mono("\".\"") & " in the new settings.")), Definition( - CmdOption("sourcepath", Argument("path")), - "Specify where to find input source files."), - Definition( - CmdOption("bootclasspath", Argument("path")), - "Override location of bootstrap class files (where to find the " & - "standard built-in classes, such as \"" & Mono("scala.List") & "\")."), - Definition( - CmdOption("extdirs", Argument("dirs")), - "Override location of installed extensions."), - Definition( - CmdOption("d", Argument("directory")), + CmdOption("d", Argument("directory|jar")), "Specify where to place generated class files."), Definition( + CmdOption("deprecation"), + SeqPara( + "Emit warning and location for usages of deprecated APIs.", + "Available since Scala version 2.2.1")), + Definition( CmdOption("encoding", Argument("encoding")), SeqPara( "Specify character encoding used by source files.", @@ -122,77 +103,165 @@ object scalac extends Command { MBold(" scala> ") & Mono("new java.io.InputStreamReader(System.in).getEncoding"))), Definition( - CmdOption("target:", Argument("target")), + CmdOption("explaintypes"), + "Explain type errors in more detail."), + Definition( + CmdOption("extdirs", Argument("dirs")), + "Override location of installed extensions."), + Definition( + CmdOptionBound("g:", "{none,source,line,vars,notailcalls}"), + SeqPara( + Mono("\"none\"") & " generates no debugging info,", + Mono("\"source\"") & " generates only the source file attribute,", + Mono("\"line\"") & " generates source and line number information,", + Mono("\"vars\"") & " generates source, line number and local " & + "variable information,", + Mono("\"notailcalls\"") & " generates all of the above and " & + Italic("will not") & " perform tail call optimization.")), + Definition( + CmdOption("help"), + "Print a synopsis of standard options."), + Definition( + CmdOption("javabootclasspath", Argument("path")), + "Override Java boot classpath."), + Definition( + CmdOption("javaextdirs", Argument("path")), + "Override Java extdirs classpath."), + Definition( + CmdOption("no-specialization"), + "Ignore " & MItalic("@specialize") & " annotations."), + Definition( + CmdOption("nobootcp"), + "Do not use the boot classpath for the Scala jar files."), + Definition( + CmdOption("nowarn"), + "Generate no warnings"), + Definition( + CmdOption("optimise"), + "Generates faster bytecode by applying optimisations to the program."), + Definition( + CmdOption("print"), + "Print program with all Scala-specific features removed."), + Definition( + CmdOption("sourcepath", Argument("path")), + "Specify location(s) of source files."), + Definition( + CmdOptionBound("target:", Argument("target")), SeqPara( "Specify which backend to use (" & Mono("jvm-1.5," & "msil") & ").", "The default value is " & Mono("\"jvm-1.5\"") & " (was " & Mono("\"jvm-1.4\"") & " up to Scala version 2.6.1).")), Definition( - CmdOption("print"), - "Print program with all Scala-specific features removed" - ), - Definition( - CmdOption("optimise"), - "Generates faster bytecode by applying optimisations to the program" - ), + CmdOption("toolcp", Argument("path")), + "Add to the runner classpath."), Definition( - CmdOption("explaintypes"), - "Explain type errors in more detail."), + CmdOption("unchecked"), + SeqPara( + "Enable detailed unchecked (erasure) warnings", + "Non variable type-arguments in type patterns are unchecked " & + "since they are eliminated by erasure", + "Available since Scala version 2.3.0")), Definition( CmdOption("uniqid"), - "Print identifiers with unique names (debugging option)."), + "Uniquely tag all identifiers in debugging output."), + Definition( + CmdOption("verbose"), + "Output messages about what the compiler is doing"), Definition( CmdOption("version"), "Print product version and exit."), Definition( - /*CmdOption("?") & "| " &*/ CmdOption("help"), - "Print a synopsis of standard options."))), + Mono(Bold("@") & Argument("file")), + "A text file containing compiler arguments (options and source files)") + ) + ), Section("Advanced Options", DefinitionList( Definition( - CmdOption("Xassem", Argument("file")), - "Name of the output assembly (only relevant with -target:msil)"), + CmdOption("Xassem-extdirs", Argument("dirs")), + "(Requires " & Mono("-target:msil") & + ") List of directories containing assemblies." & + " default:" & Mono("lib") & "."), + Definition( + CmdOption("Xassem-name", Argument("file")), + "(Requires " & Mono("-target:msil") & + ") Name of the output assembly."), Definition( CmdOption("Xassem-path", Argument("path")), - "List of assemblies referenced by the program (only relevant with -target:msil)"), + "(Requires " & Mono("-target:msil") & + ") List of assemblies referenced by the program."), Definition( CmdOption("Xcheck-null"), - "Emit warning on selection of nullable reference"), + "Warn upon selection of nullable reference"), + Definition( + CmdOption("Xcheckinit"), + "Wrap field accessors to throw an exception on uninitialized access."), Definition( CmdOption("Xdisable-assertions"), "Generate no assertions and assumptions"), Definition( + CmdOption("Xelide-below", Argument("n")), + "Calls to " & MItalic("@elidable") & + " methods are omitted if method priority is lower than argument."), + Definition( CmdOption("Xexperimental"), - "enable experimental extensions"), + "Enable experimental extensions"), + Definition( + CmdOption("Xfatal-warnings"), + "Fail the compilation if there are any warnings."), + Definition( + CmdOption("Xfuture"), + "Turn on future language features."), + Definition( + CmdOption("Xgenerate-phase-graph", Argument("file")), + "Generate the phase graphs (outputs .dot files) to fileX.dot."), + Definition( + CmdOption("Xlint"), + "Enable recommended additional warnings."), + Definition( + CmdOption("Xlog-implicits"), + "Show more detail on why some implicits are not applicable."), + Definition( + CmdOption("Xmax-classfile-name", Argument("n")), + "Maximum filename length for generated classes."), + Definition( + CmdOption("Xmigration"), + "Warn about constructs whose behavior may have changed between 2.7 and 2.8."), + Definition( + CmdOption("Xno-forwarders"), + "Do not generate static forwarders in mirror classes."), Definition( CmdOption("Xno-uescape"), "Disable handling of " & BSlash & "u unicode escapes"), Definition( - CmdOption("Xplug-types"), - "Parse but ignore annotations in more locations"), + CmdOption("Xnojline"), + "Do not use JLine for editing."), Definition( - CmdOption("Xplugin:", Argument("file")), + CmdOptionBound("Xplugin:", Argument("file")), "Load a plugin from a file"), Definition( - CmdOption("Xplugin-disable:", Argument("plugin")), + CmdOptionBound("Xplugin-disable:", Argument("plugin")), "Disable a plugin"), Definition( CmdOption("Xplugin-list"), "Print a synopsis of loaded plugins"), Definition( - CmdOption("Xplugin-opt:", Argument("plugin:opt")), - "Pass an option to a plugin"), + CmdOptionBound("Xplugin-require:", Argument("plugin")), + "Abort unless the given plugin(s) are available"), Definition( - CmdOption("Xplugin-require:", Argument("plugin")), - "Abort unless a plugin is available"), + CmdOption("Xpluginsdir", Argument("path")), + "Path to search compiler plugins."), Definition( - CmdOption("Xprint:", Argument("phases")), + CmdOptionBound("Xprint:", Argument("phases")), "Print out program after " & Argument("phases") & " (see below)."), Definition( + CmdOption("Xprint-icode"), + "Log internal icode to *.icode files."), + Definition( CmdOption("Xprint-pos"), - "Print tree positions (as offsets)"), + "Print tree positions, as offsets."), Definition( CmdOption("Xprint-types"), "Print tree types (debugging option)."), @@ -204,11 +273,14 @@ object scalac extends Command { "Compiler stays resident, files to compile are read from standard " & "input."), Definition( + CmdOption("Xscript", Argument("object")), + "Treat the source file as a script and wrap it in a main method."), + Definition( CmdOption("Xshow-class", Argument("class")), - "Show class info."), + "Show internal representation of class."), Definition( CmdOption("Xshow-object", Argument("object")), - "Show object info."), + "Show internal representation of object."), Definition( CmdOption("Xshow-phases"), "Print a synopsis of compiler phases."), @@ -216,8 +288,15 @@ object scalac extends Command { CmdOption("Xsource-reader", Argument("classname")), "Specify a custom method for reading source files."), Definition( - CmdOption("Xscript", Argument("object")), - "Compile as a script, wrapping the code into object.main().") + CmdOption("Xsourcedir", Argument("path")), + "(Requires " & Mono("-target:msil") & + ") Mirror source folder structure in output directory.."), + Definition( + CmdOption("Xverify"), + "Verify generic signatures in generated bytecode."), + Definition( + CmdOption("Y"), + "Print a synopsis of private options.") ) ), @@ -352,13 +431,14 @@ object scalac extends Command { def manpage = new Document { title = command - date = lastModified // e.g. "June 8, 2006" - author = "Stephane Micheloud & LAMP" - version = "0.4" + date = "September 2011" + author = "Stephane Micheloud" + version = "1.0" sections = List( name, synopsis, parameters, + description, options, environment, examples, diff --git a/src/manual/scala/man1/scaladoc.scala b/src/manual/scala/man1/scaladoc.scala index 94530d2a20..a6832be4b0 100644 --- a/src/manual/scala/man1/scaladoc.scala +++ b/src/manual/scala/man1/scaladoc.scala @@ -1,11 +1,14 @@ /* NSC -- new Scala compiler - * Copyright LAMP/EPFL + * Copyright 2005-2011 LAMP/EPFL * @author Stephane Micheloud - * @author Gilles Dubochet */ package scala.man1 +/** + * @author Gilles Dubochet + * @version 1.0 + */ object scaladoc extends Command { import _root_.scala.tools.docutil.ManPage._ @@ -141,7 +144,7 @@ object scaladoc extends Command { def manpage = new Document { title = command - date = "2 June 2010" + date = "June 2010" author = "Gilles Dubochet" version = "2.0" sections = List( diff --git a/src/manual/scala/man1/scalap.scala b/src/manual/scala/man1/scalap.scala index a77e49ce4e..cc9b312dac 100644 --- a/src/manual/scala/man1/scalap.scala +++ b/src/manual/scala/man1/scalap.scala @@ -5,6 +5,10 @@ package scala.man1 +/** + * @author Stephane Micheloud + * @version 1.0 + */ object scalap extends Command { import _root_.scala.tools.docutil.ManPage._ @@ -89,9 +93,9 @@ object scalap extends Command { def manpage = new Document { title = command - date = "June 8, 2006" + date = "June 2006" author = "Stephane Micheloud" - version = "0.2" + version = "1.0" sections = List( name, synopsis, |