diff --git a/src/manual/scala/man1/scalac.scala b/src/manual/scala/man1/scalac.scala index 046371963..ee40c72b7 100644 --- a/src/manual/scala/man1/scalac.scala +++ b/src/manual/scala/man1/scalac.scala @@ -56,6 +56,19 @@ object scalac extends Command { Definition( CmdOption("g"), "Generate debugging info"), + Definition( + CmdOption("g:none"), + "Generate no debugging info"), + Definition( + CmdOption("g:{source,lines,vars,notc}"), + SeqPara( + "Generate only some debugging info.", + Mono("\"source\"") & " generates only the source file attribute,", + Mono("\"lines\"") & " 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.")), Definition( CmdOption("nowarn"), "Generate no warnings"), @@ -64,10 +77,16 @@ object scalac extends Command { "Output messages about what the compiler is doing"), Definition( CmdOption("classpath", Argument("path")), - "Specify where to find user class files (on Unix-based systems " & - "a colon-separated list of paths, on Windows-based systems, a " & - "semicolon-separate list of paths). This does not override the " & - "built-in (" & Mono("\"boot\"") & ") search path."), + SeqPara( + "Specify where to find user class files (on Unix-based systems " & + "a colon-separated list of paths, on Windows-based systems, a " & + "semicolon-separate list of paths). This does not override the " & + "built-in (" & Mono("\"boot\"") & ") search path.", + "The default class path is the current directory. Setting the " & + Mono("CLASSPATH") & " variable or using the " & Mono("-classpath") & " " & + "command-line option overrides that default, so if you want to " & + "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."), @@ -83,12 +102,20 @@ object scalac extends Command { "Specify where to place generated class files."), Definition( CmdOption("encoding", Argument("encoding")), - "Specify character encoding used by source files."), + SeqPara( + "Specify character encoding used by source files.", + "The default value is platform-specific (Linux: " & Mono("\"UTF8\"") & + ", Windows: " & Mono("\"Cp1252\"") & "). Executing the following " & + "code in the Scala interpreter will return the default value " & + "on your system:", + MBold(" scala>") & + Mono("new java.io.InputStreamReader(System.in).getEncoding"))), Definition( CmdOption("target:", Argument("target")), - "Specify which backend to use (" & Mono(Italic("jvm-1.5") & ", " & - Italic("jvm-1.4") & ", " & Italic("msil") & ", " & Italic("cldc")) & - ")."), + SeqPara( + "Specify which backend to use (" & Mono("jvm-1.5,jvm-1.4," & + "msil,cldc") & ").", + "The default value is " & Mono("\"jvm-1.4\"") & ".")), Definition( CmdOption("migrate"), "Assist in migrating from Scala version 1.0."), @@ -128,7 +155,9 @@ object scalac extends Command { "Enable gadt for classes."), Definition( CmdOption("Xlinearizer", Argument("Xlinearizer")), - "Linearizer to use (" & Mono("normal,dfs,rpo") & ")."), + SeqPara( + "Linearizer to use (" & Mono("dfs,dump,normal,rpo") & ").", + "The default value is " & Mono("\"rpo\"") & ".")), Definition( CmdOption("Xgenerics"), "Use generic Java types."))), @@ -167,7 +196,9 @@ object scalac extends Command { "Print out program after " & Argument("phases") & " (see below)."), Definition( CmdOption("printer:", Argument("printer")), - "Printer to use."), + SeqPara( + "Printer to use (" & Mono("text,html") & ").", + "The default value is " & Mono("\"text\"") & ".")), Definition( CmdOption("print-file", Argument("file")), "Specify file in which to print trees."), diff --git a/src/manual/scala/tools/docutil/EmitHtml.scala b/src/manual/scala/tools/docutil/EmitHtml.scala index 4b0f0c040..12b692a8e 100644 --- a/src/manual/scala/tools/docutil/EmitHtml.scala +++ b/src/manual/scala/tools/docutil/EmitHtml.scala @@ -20,11 +20,19 @@ object EmitHtml { /* */ def emitSection(section: Section, depth: int): Unit = { + def emitPara(text: AbstractText): Unit = { + out.println("
") + emitText(text) + out.println("\n
") + } def emitText(text: AbstractText): Unit = text match { case seq:SeqText => seq.components.foreach(emitText) + case seq:SeqPara => + seq.components.foreach(emitPara) + case Text(text) => out.print(escape(text)) @@ -77,7 +85,7 @@ object EmitHtml { out.print("") case _ => - error("unknown text node " + text) + error("unknown text node: " + text) } def emitParagraph(para: Paragraph): Unit = @@ -122,7 +130,7 @@ object EmitHtml { emitSection(sect, depth + 1) case _ => - error("unknown paragraph node " + para) + error("unknown paragraph node: " + para) } val name = section.title.replaceAll("\\p{Space}", "_").toLowerCase() diff --git a/src/manual/scala/tools/docutil/EmitManPage.scala b/src/manual/scala/tools/docutil/EmitManPage.scala index 1621078ef..fd9e0d9c0 100644 --- a/src/manual/scala/tools/docutil/EmitManPage.scala +++ b/src/manual/scala/tools/docutil/EmitManPage.scala @@ -20,11 +20,18 @@ object EmitManPage { text.replaceAll("-", "\\-") def emitSection(section: Section, depth: int): Unit = { + def emitPara(text: AbstractText): Unit = { + emitText(text) + out.println("\n.IP") + } def emitText(text: AbstractText): Unit = text match { case seq:SeqText => seq.components.foreach(emitText) + case seq:SeqPara => + seq.components.foreach(emitPara) + case Text(text) => out.print(escape(text)) @@ -70,7 +77,7 @@ object EmitManPage { emitText(label) case _ => - error("unknown text node " + text) + error("unknown text node: " + text) } def emitParagraph(para: Paragraph): Unit = @@ -115,10 +122,10 @@ object EmitManPage { emitText(text) case EmbeddedSection(sect) => - emitSection(sect, depth+1) + emitSection(sect, depth + 1) case _ => - error("unknown paragraph node " + para) + error("unknown paragraph node: " + para) } out.println(".\\\"") diff --git a/src/manual/scala/tools/docutil/ManPage.scala b/src/manual/scala/tools/docutil/ManPage.scala index 717e98eb7..a85c91df8 100644 --- a/src/manual/scala/tools/docutil/ManPage.scala +++ b/src/manual/scala/tools/docutil/ManPage.scala @@ -13,6 +13,7 @@ object ManPage { } case class SeqText(components: AbstractText*) extends AbstractText + case class SeqPara(components: AbstractText*) extends AbstractText case class Text(text: String) extends AbstractText case object MDash extends AbstractText case object NDash extends AbstractText