summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-04-10 08:40:09 +0000
committermichelou <michelou@epfl.ch>2007-04-10 08:40:09 +0000
commit9f27eacd5c5595288f66b701b8f59cc16b1529b0 (patch)
treea87bffbc11f64e486cf468e8b560eb9627baf0da /src/library
parentf96b6beefc08f56218ac68b37a4cecd757cb60ee (diff)
downloadscala-9f27eacd5c5595288f66b701b8f59cc16b1529b0.tar.gz
scala-9f27eacd5c5595288f66b701b8f59cc16b1529b0.tar.bz2
scala-9f27eacd5c5595288f66b701b8f59cc16b1529b0.zip
updated file headers
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/Application.scala36
-rw-r--r--src/library/scala/ByNameFunction.scala7
-rw-r--r--src/library/scala/Cell.scala5
-rw-r--r--src/library/scala/CountedIterator.scala7
-rw-r--r--src/library/scala/Predef.scala14
-rw-r--r--src/library/scala/cloneable.scala9
-rw-r--r--src/library/scala/reflect/Code.scala5
-rw-r--r--src/library/scala/reflect/Print.scala61
-rw-r--r--src/library/scala/reflect/Symbol.scala5
-rw-r--r--src/library/scala/reflect/Tree.scala4
-rw-r--r--src/library/scala/reflect/Type.scala5
-rw-r--r--src/library/scala/reflect/TypedCode.scala4
-rw-r--r--src/library/scala/transient.scala9
-rw-r--r--src/library/scala/util/regexp/Base.scala4
-rw-r--r--src/library/scala/util/regexp/PointedHedgeExp.scala4
-rw-r--r--src/library/scala/util/regexp/SyntaxError.scala6
-rw-r--r--src/library/scala/util/regexp/WordExp.scala15
-rw-r--r--src/library/scala/volatile.scala5
-rw-r--r--src/library/scala/xml/pull/XMLEvent.scala11
-rw-r--r--src/library/scala/xml/pull/XMLEventReader.scala86
-rw-r--r--src/library/scala/xml/transform/BasicTransformer.scala25
-rw-r--r--src/library/scala/xml/transform/RewriteRule.scala5
-rw-r--r--src/library/scala/xml/transform/RuleTransformer.scala21
23 files changed, 192 insertions, 161 deletions
diff --git a/src/library/scala/Application.scala b/src/library/scala/Application.scala
index 672969e91c..da34a4d224 100644
--- a/src/library/scala/Application.scala
+++ b/src/library/scala/Application.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,27 +11,29 @@
package scala
-
-import compat.Platform.currentTime
import java.lang.System.getProperty
+import scala.compat.Platform.currentTime
-/** The <code>Application</code> class can be used to quickly turn objects
- * into executable programs. Here is an example:
- * <pre>
+/** <p>
+ * The <code>Application</code> class can be used to quickly turn objects
+ * into executable programs. Here is an example:
+ * </p><pre>
* <b>object</b> Main <b>extends</b> Application {
* Console.println("Hello World!")
* }
* </pre>
- * Here, object <code>Main</code> inherits the <code>main</code> method
- * of <code>Application</code>. The body of the <code>Main</code> object
- * defines the main program. This technique does not work if the main
- * program depends on command-line arguments (which are not accessible
- * with the technique presented here).
- *
- * It is possible to time the execution of objects that inherit from
- * class <code>Application</code> by setting the global scala.time property.
- * Here is an example for benchmarking object <code>Main</code>:
- * <pre>
+ * <p>
+ * Here, object <code>Main</code> inherits the <code>main</code> method
+ * of <code>Application</code>. The body of the <code>Main</code> object
+ * defines the main program. This technique does not work if the main
+ * program depends on command-line arguments (which are not accessible
+ * with the technique presented here).
+ * </p>
+ * <p>
+ * It is possible to time the execution of objects that inherit from class
+ * <code>Application</code> by setting the global <code>scala.time</code>
+ * property. Here is an example for benchmarking object <code>Main</code>:
+ * </p><pre>
* java -Dscala.time Main
* </pre>
*
diff --git a/src/library/scala/ByNameFunction.scala b/src/library/scala/ByNameFunction.scala
index a14a5a454d..1540602e5b 100644
--- a/src/library/scala/ByNameFunction.scala
+++ b/src/library/scala/ByNameFunction.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -9,8 +9,7 @@
// $Id$
-package scala;
-
+package scala
/** A partial function of type <code>PartialFunction[A, B]</code> is a
* unary function where the domain does not include all values of type
diff --git a/src/library/scala/Cell.scala b/src/library/scala/Cell.scala
index b9e3ed7a7e..9b44406091 100644
--- a/src/library/scala/Cell.scala
+++ b/src/library/scala/Cell.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,7 +11,6 @@
package scala
-
/** A <code>Cell</code> is a generic wrapper which completely
* hides the functionality of the wrapped object. The wrapped
* object is accessible via the <code>elem</code> accessor method.
diff --git a/src/library/scala/CountedIterator.scala b/src/library/scala/CountedIterator.scala
index ab95b97d52..9293197f9a 100644
--- a/src/library/scala/CountedIterator.scala
+++ b/src/library/scala/CountedIterator.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -9,8 +9,7 @@
// $Id$
-package scala;
-
+package scala
/** Counted iterators keep track of the number of elements seen so far
*
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala
index c2fd61a124..d80968b760 100644
--- a/src/library/scala/Predef.scala
+++ b/src/library/scala/Predef.scala
@@ -304,6 +304,20 @@ object Predef {
implicit def double2Double(x: double) = new java.lang.Double(x)
implicit def boolean2Boolean(x: boolean) = new java.lang.Boolean(x)
+ implicit def byte2Type(x: byte) = ObjectType(classOf[byte])
+ implicit def short2Type(x: short) = ObjectType(classOf[short])
+ implicit def char2Type(x: char) = ObjectType(classOf[char])
+ implicit def int2Type(x: int) = ObjectType(classOf[int])
+ implicit def long2Type(x: long) = ObjectType(classOf[long])
+ implicit def float2Type(x: float) = ObjectType(classOf[float])
+ implicit def double2Type(x: double) = ObjectType(classOf[double])
+ implicit def boolean2Type(x: boolean) = ObjectType(classOf[boolean])
+ implicit def object2Type(x: AnyRef) = ObjectType(x.getClass)
+ implicit def any2Type(a: Any) = a match {
+ case x: AnyRef => ObjectType(x.getClass)
+ case _ => null
+ }
+
def currentThread = java.lang.Thread.currentThread()
}
diff --git a/src/library/scala/cloneable.scala b/src/library/scala/cloneable.scala
index aba6f72a33..7853f604be 100644
--- a/src/library/scala/cloneable.scala
+++ b/src/library/scala/cloneable.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -9,10 +9,9 @@
// $Id$
-package scala;
-
+package scala
/**
* An annotation that designates the class to which it is applied as cloneable
*/
-class cloneable extends Annotation {}
+class cloneable extends Annotation
diff --git a/src/library/scala/reflect/Code.scala b/src/library/scala/reflect/Code.scala
index 780bd5518c..ddf785a8b2 100644
--- a/src/library/scala/reflect/Code.scala
+++ b/src/library/scala/reflect/Code.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,7 +11,6 @@
package scala.reflect
-
import Predef.Error
class Code[Type](val tree: Tree)
diff --git a/src/library/scala/reflect/Print.scala b/src/library/scala/reflect/Print.scala
index 166a2631c1..3cadbc68af 100644
--- a/src/library/scala/reflect/Print.scala
+++ b/src/library/scala/reflect/Print.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -13,7 +13,7 @@ package scala.reflect
object Print extends Function1[Any, String] {
- def apply (any: Any): String =
+ def apply(any: Any): String =
if (any.isInstanceOf[Code[Any]])
apply(any.asInstanceOf[Code[Any]])
else if (any.isInstanceOf[Tree])
@@ -28,8 +28,10 @@ object Print extends Function1[Any, String] {
Print(code.tree)
def apply(tree: Tree): String = tree match {
- case reflect.Ident(sym) => Print(sym)
- case reflect.Select(qual, sym) => Print(qual) + "." + Print(sym)
+ case reflect.Ident(sym) =>
+ Print(sym)
+ case reflect.Select(qual, sym) =>
+ Print(qual) + "." + Print(sym)
case reflect.Literal(value) => value match {
case s:String => "\"" + s + "\""
case _ => value.toString
@@ -40,10 +42,12 @@ object Print extends Function1[Any, String] {
Print(fun) + args.map(Print).mkString("[", ", ", "]")
case reflect.Function(params, body) =>
params.map(Print).mkString("(", ", ", ")") + " => " + Print(body)
- case reflect.This(sym) => Print(sym)
+ case reflect.This(sym) =>
+ Print(sym)
case reflect.Block(stats, expr) =>
(stats ::: List(expr)).map(Print).mkString("{\n", ";\n", "\n}")
- case reflect.New(tpt) => "new " + Print(tpt)
+ case reflect.New(tpt) =>
+ "new " + Print(tpt)
case reflect.If(condition, trueCase, falseCase) =>
"if (" + Print(condition) + ") " + Print(trueCase) + " else " + Print(falseCase)
case reflect.Assign(destination: Tree, source: Tree) =>
@@ -52,36 +56,46 @@ object Print extends Function1[Any, String] {
"target " + Print(sym) + " {\n" + Print(body) + "\n}"
case reflect.Goto(target) =>
"goto " + Print(target)
- case _ => "???"
+ case _ =>
+ "???"
}
def apply(symbol: Symbol): String = symbol match {
- case reflect.Class(name) => name.substring(name.lastIndexOf('.')+1)
+ case reflect.Class(name) =>
+ name.substring(name.lastIndexOf('.') + 1)
case reflect.Method(name, datatype) =>
- name.substring(name.lastIndexOf('.')+1) //+ ": " + datatype
+ name.substring(name.lastIndexOf('.') +1)
case reflect.Field(name, datatype) =>
- name.substring(name.lastIndexOf('.')+1) //+ ": " + datatype
+ name.substring(name.lastIndexOf('.') + 1)
case reflect.TypeField(name, datatype) =>
- name.substring(name.lastIndexOf('.')+1) //+ ": " + datatype
+ name.substring(name.lastIndexOf('.') + 1)
case reflect.LocalValue(owner, name, datatype) =>
- name.substring(name.lastIndexOf('.')+1) //+ ": " + datatype
+ name.substring(name.lastIndexOf('.') + 1)
case reflect.LocalMethod(owner, name, datatype) =>
- name.substring(name.lastIndexOf('.')+1) //+ ": " + datatype
- case reflect.NoSymbol => "NoSymbol"
- case reflect.RootSymbol => "RootSymbol"
- case reflect.LabelSymbol(name) => name
- case _ => "???"
+ name.substring(name.lastIndexOf('.') + 1)
+ case reflect.NoSymbol =>
+ "NoSymbol"
+ case reflect.RootSymbol =>
+ "RootSymbol"
+ case reflect.LabelSymbol(name) =>
+ name
+ case _ =>
+ "???"
}
def apply(datatype: Type): String = datatype match {
- case reflect.NoPrefix => "NoPrefix"
- case reflect.NoType => "NoType"
- case reflect.NamedType(name) => "(named: " + name + ")"
+ case reflect.NoPrefix =>
+ "NoPrefix"
+ case reflect.NoType =>
+ "NoType"
+ case reflect.NamedType(name) =>
+ "(named: " + name + ")"
case reflect.PrefixedType(prefix, symbol) =>
"(" + Print(prefix) + "." + Print(symbol) + ")"
case reflect.SingleType(prefix, symbol) =>
"(" + Print(prefix) + "." + Print(symbol) + ")"
- case reflect.ThisType(clazz) => "(" + Print(clazz) + ".this.type)"
+ case reflect.ThisType(clazz) =>
+ "(" + Print(clazz) + ".this.type)"
case reflect.AppliedType(datatype, args) =>
Print(datatype) + args.map(Print).mkString("[", ", ", "]")
case reflect.TypeBounds(lo, hi) =>
@@ -92,7 +106,8 @@ object Print extends Function1[Any, String] {
(List.map2(typeParams, typeBounds)
((tp, tb) => "[" + Print(tb._1) + " :> " + Print(tp) + " :> " + Print(tb._2) + "]")).
mkString("[", ", ", "]") + " -> " + Print(resultType)
- case _ => "???"
+ case _ =>
+ "???"
}
}
diff --git a/src/library/scala/reflect/Symbol.scala b/src/library/scala/reflect/Symbol.scala
index 73dcc8891d..56e1943292 100644
--- a/src/library/scala/reflect/Symbol.scala
+++ b/src/library/scala/reflect/Symbol.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,7 +11,6 @@
package scala.reflect
-
import Predef._
abstract class Symbol {
diff --git a/src/library/scala/reflect/Tree.scala b/src/library/scala/reflect/Tree.scala
index 971df24c83..5c07a71eb9 100644
--- a/src/library/scala/reflect/Tree.scala
+++ b/src/library/scala/reflect/Tree.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
diff --git a/src/library/scala/reflect/Type.scala b/src/library/scala/reflect/Type.scala
index 4beacbf854..bbc411854a 100644
--- a/src/library/scala/reflect/Type.scala
+++ b/src/library/scala/reflect/Type.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,7 +11,6 @@
package scala.reflect
-
import Predef._
abstract class Type
diff --git a/src/library/scala/reflect/TypedCode.scala b/src/library/scala/reflect/TypedCode.scala
index 0833fb204e..aff53ca7a1 100644
--- a/src/library/scala/reflect/TypedCode.scala
+++ b/src/library/scala/reflect/TypedCode.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
diff --git a/src/library/scala/transient.scala b/src/library/scala/transient.scala
index f3d03fd1d9..d20b2e8c59 100644
--- a/src/library/scala/transient.scala
+++ b/src/library/scala/transient.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -9,7 +9,6 @@
// $Id$
-package scala;
+package scala
-
-class transient extends Annotation {}
+class transient extends Annotation
diff --git a/src/library/scala/util/regexp/Base.scala b/src/library/scala/util/regexp/Base.scala
index 92195eff42..ee67a29b38 100644
--- a/src/library/scala/util/regexp/Base.scala
+++ b/src/library/scala/util/regexp/Base.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
diff --git a/src/library/scala/util/regexp/PointedHedgeExp.scala b/src/library/scala/util/regexp/PointedHedgeExp.scala
index 2d87639fdf..ed6af2fe70 100644
--- a/src/library/scala/util/regexp/PointedHedgeExp.scala
+++ b/src/library/scala/util/regexp/PointedHedgeExp.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
diff --git a/src/library/scala/util/regexp/SyntaxError.scala b/src/library/scala/util/regexp/SyntaxError.scala
index b1282f7fb6..0baa5fafb7 100644
--- a/src/library/scala/util/regexp/SyntaxError.scala
+++ b/src/library/scala/util/regexp/SyntaxError.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -17,4 +17,4 @@ package scala.util.regexp
* @author Burak Emir
* @version 1.0
*/
-class SyntaxError(e: String) extends java.lang.RuntimeException(e)
+class SyntaxError(e: String) extends RuntimeException(e)
diff --git a/src/library/scala/util/regexp/WordExp.scala b/src/library/scala/util/regexp/WordExp.scala
index e4cfbe0dfb..062b766e92 100644
--- a/src/library/scala/util/regexp/WordExp.scala
+++ b/src/library/scala/util/regexp/WordExp.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,11 +11,12 @@
package scala.util.regexp
-/** This class provides regular word expressions. Users have to instantiate
- * type member <code>_regexpT &lt;: RegExp</code> (from class <code>Base</code>)
- * and a type member <code>_labelT &lt;: Label</code>.
- * Here is a little example:
- * <pre>
+/** <p>
+ * The class <code>WordExp</code> provides regular word expressions.
+ * Users have to instantiate type member <code>_regexpT &lt;: RegExp</code>
+ * (from class <code>Base</code>) and a type member
+ * <code>_labelT &lt;: Label</code>. Here is a short example:
+ * </p><pre>
* <b>import</b> scala.util.regexp._
* <b>import</b> scala.util.automata._
* <b>object</b> MyLang <b>extends</b> WordExp {
diff --git a/src/library/scala/volatile.scala b/src/library/scala/volatile.scala
index d8a1afcb68..ef1ca4e8e6 100644
--- a/src/library/scala/volatile.scala
+++ b/src/library/scala/volatile.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,5 +11,4 @@
package scala
-
class volatile extends Annotation
diff --git a/src/library/scala/xml/pull/XMLEvent.scala b/src/library/scala/xml/pull/XMLEvent.scala
index 50e657489d..622a3e7b87 100644
--- a/src/library/scala/xml/pull/XMLEvent.scala
+++ b/src/library/scala/xml/pull/XMLEvent.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,11 +11,10 @@
package scala.xml.pull
-/** represents an XMLEvent for pull parsing
+/** This class represents an XML event for pull parsing.
*/
-trait XMLEvent {
-}
+trait XMLEvent
-case class ElemStart(pre: String, label: String, attrs: MetaData, scope:NamespaceBinding) extends XMLEvent
+case class ElemStart(pre: String, label: String, attrs: MetaData, scope: NamespaceBinding) extends XMLEvent
case class ElemEnd(pre: String, label: String) extends XMLEvent
diff --git a/src/library/scala/xml/pull/XMLEventReader.scala b/src/library/scala/xml/pull/XMLEventReader.scala
index 130d7afe19..0577cc52c5 100644
--- a/src/library/scala/xml/pull/XMLEventReader.scala
+++ b/src/library/scala/xml/pull/XMLEventReader.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -15,32 +15,34 @@ package scala.xml.pull
import java.lang.{Runnable, Thread}
import scala.io.Source
-import scala.xml.parsing.{MarkupParser, MarkupHandler,ExternalSources}
-
-/** a pull parser that offers to view an XML document as a series of events.
- * Please note that this API might change. Here's how to use this class
+import scala.xml.parsing.{ExternalSources, MarkupHandler, MarkupParser}
+
+/** <p>
+ * A pull parser that offers to view an XML document as a series of events.
+ * Please note that this API might change. Here's how to use this class
+ * </p><pre>
+ * <b>import</b> scala.xml._
+ * <b>import</b> scala.xml.pull._
+ * <b>import</b> scala.io.Source
*
-<pre>
-import scala.xml._
-import scala.xml.pull._
-import scala.io.Source
-
-object reader {
- val src = Source.fromString("<hello><world/></hello>")
- val er = new XMLEventReader().initialize(src)
-
- def main(args:Array[String]): unit = {
- Console.println(er.next)
- Console.println(er.next)
- }
-}
-</pre>
+ * <b>object</b> reader {
+ * <b>val</b> src = Source.fromString("<hello><world/></hello>")
+ * <b>val</b> er = new XMLEventReader().initialize(src)
+ *
+ * <b>def</b> main(args: Array[String]) {
+ * Console.println(er.next)
+ * Console.println(er.next)
+ * }
+ * }
+ * </pre>
+ *
+ * @author Burak Emir
*/
class XMLEventReader extends Iterator[XMLEvent] {
var src:Source = null
def getSource = this.src
- def initialize(src:Source): this.type = {
+ def initialize(src: Source): this.type = {
this.src = src
this.parserThread = new Thread(new Parser())
this.parserThread.start()
@@ -55,7 +57,7 @@ class XMLEventReader extends Iterator[XMLEvent] {
while(continue) {
wait()
}
- continue = true;
+ continue = true
notifyAll
}
def getAndClearEvent: XMLEvent = synchronized {
@@ -66,21 +68,21 @@ class XMLEventReader extends Iterator[XMLEvent] {
xmlEvent = null
r
}
- def setEvent(e:XMLEvent) = {
- xmlEvent = e;
+ def setEvent(e: XMLEvent) {
+ xmlEvent = e
}
def doNotify() = synchronized {
- XMLEventReader.this.continue = false;
+ XMLEventReader.this.continue = false
notifyAll()
- while(!XMLEventReader.this.continue) wait();
+ while (!XMLEventReader.this.continue) wait();
NodeSeq.Empty
}
// iterator methods
def next: XMLEvent = {
- myresume;
+ myresume
val r = getAndClearEvent
r
}
@@ -94,34 +96,34 @@ class XMLEventReader extends Iterator[XMLEvent] {
val preserveWS = true
val input = XMLEventReader.this.getSource
- override def elemStart(pos:int, pre: String, label: String, attrs: MetaData, scope:NamespaceBinding):Unit = {
- setEvent(ElemStart(pre,label,attrs,scope)); doNotify
+ override def elemStart(pos:int, pre: String, label: String, attrs: MetaData, scope: NamespaceBinding) {
+ setEvent(ElemStart(pre, label, attrs, scope)); doNotify
}
- override def elemEnd(pos: int, pre: String, label: String): Unit = {
- setEvent(ElemEnd(pre,label)); doNotify
+ override def elemEnd(pos: int, pre: String, label: String) {
+ setEvent(ElemEnd(pre, label)); doNotify
}
final def elem(pos: int, pre: String, label: String, attrs: MetaData, pscope: NamespaceBinding, nodes: NodeSeq): NodeSeq =
NodeSeq.Empty
- def procInstr(pos: Int, target: String, txt: String ) = {
- setEvent(ElemStart(null,"comm",null,null)); doNotify
+ def procInstr(pos: Int, target: String, txt: String) {
+ setEvent(ElemStart(null, "comm", null, null)); doNotify
}
- def comment(pos: Int, txt: String ) = {
- setEvent(ElemStart(null,"comm",null,null)); doNotify
+ def comment(pos: Int, txt: String) {
+ setEvent(ElemStart(null, "comm", null, null)); doNotify
}
- def entityRef(pos: Int, n: String) = {
- setEvent(ElemStart(null,"eref",null,null)); doNotify
- }
+ def entityRef(pos: Int, n: String) {
+ setEvent(ElemStart(null, "eref", null, null)); doNotify
+ }
- def text(pos: Int, txt:String) = {
- setEvent(ElemStart(null,"tex",null,null)); doNotify
+ def text(pos: Int, txt:String) {
+ setEvent(ElemStart(null, "tex", null, null)); doNotify
}
- override def run(): unit = {
+ override def run() {
curInput = input
this.nextch
doNotify()
diff --git a/src/library/scala/xml/transform/BasicTransformer.scala b/src/library/scala/xml/transform/BasicTransformer.scala
index 8364e498d4..e20acdba70 100644
--- a/src/library/scala/xml/transform/BasicTransformer.scala
+++ b/src/library/scala/xml/transform/BasicTransformer.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,7 +11,6 @@
package scala.xml.transform
-
/** A class for XML transformations.
*
* @author Burak Emir
@@ -19,28 +18,36 @@ package scala.xml.transform
*/
abstract class BasicTransformer extends Function1[Node,Node] {
- protected case class NeedsCopy(result: Seq[Node]) extends java.lang.Throwable
+ protected case class NeedsCopy(result: Seq[Node]) extends Throwable
/** Returns a new node buffer with the first <code>pos</code> elements
* from <code>ns</code>.
+ *
+ * @param pos ..
+ * @param ns ..
+ * @return ..
*/
- protected def buffer(pos: Int, ns :Seq[Node]): NodeBuffer = {
+ protected def buffer(pos: Int, ns: Seq[Node]): NodeBuffer = {
val nb = new NodeBuffer()
var jt = ns.elements
var j = 0; while (j < pos-1) {
nb.append(jt.next)
- j = j + 1
+ j += 1
}
nb
}
- /** turns a nodebuffer into a sequence, so hashcode works */
+ /** Turns a nodebuffer into a sequence, so hashcode works.
+ *
+ * @param nb ..
+ * @return ..
+ */
protected def freeze(nb: NodeBuffer): Seq[Node] = {
val arr = new Array[Node](nb.length)
var i = 0
val it = nb.elements; while (it.hasNext) {
arr(i) = it.next
- i = i + 1
+ i += 1
}
val seq: Seq[Node] = arr
seq
@@ -79,7 +86,7 @@ abstract class BasicTransformer extends Function1[Node,Node] {
if (!unchanged(n, n2)) {
throw NeedsCopy(n2)
}
- i = i + 1
+ i += 1
}
ns
} catch {
diff --git a/src/library/scala/xml/transform/RewriteRule.scala b/src/library/scala/xml/transform/RewriteRule.scala
index 8100e6eae9..08412c79e9 100644
--- a/src/library/scala/xml/transform/RewriteRule.scala
+++ b/src/library/scala/xml/transform/RewriteRule.scala
@@ -1,13 +1,14 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id$
+
package scala.xml.transform
/** a RewriteRule, when applied to a term, yields either
diff --git a/src/library/scala/xml/transform/RuleTransformer.scala b/src/library/scala/xml/transform/RuleTransformer.scala
index f8d2ecc413..d93f6f5b65 100644
--- a/src/library/scala/xml/transform/RuleTransformer.scala
+++ b/src/library/scala/xml/transform/RuleTransformer.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -9,17 +9,16 @@
// $Id$
-package scala.xml.transform;
+package scala.xml.transform
-
-class RuleTransformer(rules:RewriteRule*) extends BasicTransformer {
- override def transform(n:Node): Seq[Node] = {
- var m: Seq[Node] = super.transform(n);
- val it = rules.elements; while(it.hasNext) {
- val rule = it.next;
- val m2 = rule.transform(m);
+class RuleTransformer(rules: RewriteRule*) extends BasicTransformer {
+ override def transform(n: Node): Seq[Node] = {
+ var m: Seq[Node] = super.transform(n)
+ val it = rules.elements; while (it.hasNext) {
+ val rule = it.next
+ val m2 = rule.transform(m)
//if(!m2.eq(m)) Console.println("applied rule \""+rule.name+"\"");
- m = m2;
+ m = m2
}
m
}