summaryrefslogtreecommitdiff
path: root/src/manual
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2008-08-19 17:48:04 +0000
committermichelou <michelou@epfl.ch>2008-08-19 17:48:04 +0000
commit9577fff49c2e0ee6b26f813936d3fa23a2dee22a (patch)
tree9c98fa6b4a6bc1333f29c1abe351cb39e5515cf8 /src/manual
parent56eb012d9f0fb00aa4cec06df32adca5d4cd8d71 (diff)
downloadscala-9577fff49c2e0ee6b26f813936d3fa23a2dee22a.tar.gz
scala-9577fff49c2e0ee6b26f813936d3fa23a2dee22a.tar.bz2
scala-9577fff49c2e0ee6b26f813936d3fa23a2dee22a.zip
int -> Int, etc.
Diffstat (limited to 'src/manual')
-rw-r--r--src/manual/scala/tools/docutil/EmitHtml.scala18
-rw-r--r--src/manual/scala/tools/docutil/EmitManPage.scala13
2 files changed, 18 insertions, 13 deletions
diff --git a/src/manual/scala/tools/docutil/EmitHtml.scala b/src/manual/scala/tools/docutil/EmitHtml.scala
index e5093c2296..629a8334b3 100644
--- a/src/manual/scala/tools/docutil/EmitHtml.scala
+++ b/src/manual/scala/tools/docutil/EmitHtml.scala
@@ -1,5 +1,5 @@
/* NSC -- new Scala compiler
- * Copyright 2005-2007 LAMP/EPFL
+ * Copyright 2005-2008 LAMP/EPFL
* @author Stephane Micheloud
* Adapted from Lex Spoon's sbaz manual
*/
@@ -19,13 +19,13 @@ object EmitHtml {
.replaceAll(">", "&gt;")
/* */
- def emitSection(section: Section, depth: int) {
+ def emitSection(section: Section, depth: Int) {
def emitPara(text: AbstractText) {
out.println("<div>")
emitText(text)
out.println("\n</div>")
}
- def emitText(text: AbstractText): Unit =
+ def emitText(text: AbstractText) {
text match {
case seq:SeqText =>
seq.components.foreach(emitText)
@@ -90,8 +90,9 @@ object EmitHtml {
case _ =>
error("unknown text node: " + text)
}
+ }
- def emitParagraph(para: Paragraph): Unit =
+ def emitParagraph(para: Paragraph) {
para match {
case TextParagraph(text) =>
out.println("<p>")
@@ -135,6 +136,7 @@ object EmitHtml {
case _ =>
error("unknown paragraph node: " + para)
}
+ }
val name = section.title.replaceAll("\\p{Space}", "_").toLowerCase()
out.println("\n<h" + depth + " id=\"" + name + "\">" +
@@ -143,7 +145,7 @@ object EmitHtml {
section.paragraphs.foreach(emitParagraph)
}
- private def emit3columns(col1: String, col2: String, col3: String) = {
+ private def emit3columns(col1: String, col2: String, col3: String) {
out.println("<div style=\"float:left;\">")
out.println(col1)
out.println("</div>")
@@ -155,21 +157,21 @@ object EmitHtml {
out.println("</div>")
}
- private def emitHeader(col1: String, col2: String, col3: String) = {
+ private def emitHeader(col1: String, col2: String, col3: String) {
out.println("<!-- header -->")
out.println("<div style=\"margin: 0 0 2em 0;\">")
emit3columns(col1, col2, col3)
out.println("</div>")
}
- private def emitFooter(col1: String, col2: String, col3: String) = {
+ private def emitFooter(col1: String, col2: String, col3: String) {
out.println("<!-- footer -->")
out.println("<div style=\"margin: 2em 0 0 0;\">")
emit3columns(col1, col2, col3)
out.println("</div>")
}
- def emitDocument(document: Document) = {
+ def emitDocument(document: Document) {
out.println("<?xml version=\"1.1\" encoding=\"" + document.encoding + "\"?>")
out.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">")
out.println("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n")
diff --git a/src/manual/scala/tools/docutil/EmitManPage.scala b/src/manual/scala/tools/docutil/EmitManPage.scala
index f76d6248de..32bffed949 100644
--- a/src/manual/scala/tools/docutil/EmitManPage.scala
+++ b/src/manual/scala/tools/docutil/EmitManPage.scala
@@ -1,5 +1,5 @@
/* NSC -- new Scala compiler
- * Copyright 2005-2007 LAMP/EPFL
+ * Copyright 2005-2008 LAMP/EPFL
* @author Stephane Micheloud
* Adapted from Lex Spoon's sbaz manual
*/
@@ -19,12 +19,12 @@ object EmitManPage {
def escape(text: String) =
text.replaceAll("-", "\\-")
- def emitSection(section: Section, depth: int) {
+ def emitSection(section: Section, depth: Int) {
def emitPara(text: AbstractText) {
emitText(text)
out.println("\n.IP")
}
- def emitText(text: AbstractText): Unit =
+ def emitText(text: AbstractText) {
text match {
case seq:SeqText =>
seq.components.foreach(emitText)
@@ -82,8 +82,9 @@ object EmitManPage {
case _ =>
error("unknown text node: " + text)
}
+ }
- def emitParagraph(para: Paragraph): Unit =
+ def emitParagraph(para: Paragraph) {
para match {
case TextParagraph(text) =>
out.println(".PP")
@@ -130,6 +131,7 @@ object EmitManPage {
case _ =>
error("unknown paragraph node: " + para)
}
+ }
out.println(".\\\"")
out.println(".\\\" ############################## " + section.title + " ###############################")
@@ -162,7 +164,7 @@ object EmitManPage {
doc.sections.foreach(s => emitSection(s, 1))
}
- def main(args: Array[String]) =
+ def main(args: Array[String]) {
try {
val cl = this.getClass.getClassLoader()
val clasz = cl.loadClass(args(0))
@@ -175,6 +177,7 @@ object EmitManPage {
System.err.println("Error in EmitManPage")
exit(1)
}
+ }
def emitManPage(classname: String, outStream: java.io.OutputStream) {
out.setOut(outStream)