summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/reference/ReferencePart.tex2
-rw-r--r--sources/scala/xml/NodeBuffer.scala43
-rw-r--r--sources/scala/xml/NodeSeq.scala4
3 files changed, 25 insertions, 24 deletions
diff --git a/doc/reference/ReferencePart.tex b/doc/reference/ReferencePart.tex
index 848a4ba846..260053ef98 100644
--- a/doc/reference/ReferencePart.tex
+++ b/doc/reference/ReferencePart.tex
@@ -36,7 +36,7 @@ to the ASCII fragment \Urange{0000}{007F}.
In Scala mode, \textit{Unicode escapes} are replaced by the corresponding
Unicode character with the given hexadecimal code.
\begin{lstlisting}
-UnicodeEscape ::= \\{\\\\}u{u} HexDigit HexDigit HexDigit HexDigit
+UnicodeEscape ::= \{\\}u{u} HexDigit HexDigit HexDigit HexDigit
HexDigit ::= '0' | $\ldots$ | `9' | `A' | $\ldots$ | `F' | `a' | $\ldots$ | `f' |
\end{lstlisting}
To construct tokens, characters are distinguished according to the following classes
diff --git a/sources/scala/xml/NodeBuffer.scala b/sources/scala/xml/NodeBuffer.scala
index fc2c415106..93d3e9387c 100644
--- a/sources/scala/xml/NodeBuffer.scala
+++ b/sources/scala/xml/NodeBuffer.scala
@@ -24,33 +24,30 @@ class NodeBuffer extends scala.collection.mutable.ArrayBuffer[Node] {
* Append a single node to this buffer, returns reference on this
* NodeBuffer for convenience.
*
- * @param n
- */
- override def +(n: Node): NodeBuffer = { super.+(n); this }
-
- /**
- * Append a sequence of nodes to this buffer, returns reference on
+ * Append an iterable object to this buffer, returns reference on
* this NodeBuffer for convenience.
*
- * @param ns
- */
- def +(ns: Iterable[Node]): NodeBuffer = { super.++(ns); this }
-
-
- /**
- * Append a sequence of nodes to this buffer, returns reference on
- * this NodeBuffer for convenience.
- *
- * @param ns
- */
- def +(ns: Iterator[Node]): NodeBuffer = { ns.foreach{x => super.+(x)}; this }
-
- /**
* Append given string as a <code>scala.xml.Text</code> node to this
* buffer, returns reference on this NodeBuffer for convenience.
*
- * @param t
+ * @param n
*/
- def +(t :String): NodeBuffer = { super.+(Text(t)); this }
-
+ def +(o: Any): NodeBuffer = {
+ o.match {
+ case n:Node => super.+(n);
+ case ns:Iterable[AnyRef] =>
+ val it = ns.elements;
+ while(it.hasNext) {
+ this.+(it.next)
+ }
+ case _ => super.+(Text(o.toString()));
+ }
+ this
+ }
+ /*
+ def +(o: AnyVal): NodeBuffer = {
+ super.+(Text(o.toString()));
+ this
+ }
+ */
}
diff --git a/sources/scala/xml/NodeSeq.scala b/sources/scala/xml/NodeSeq.scala
index f8982bc3d9..56a72b30d8 100644
--- a/sources/scala/xml/NodeSeq.scala
+++ b/sources/scala/xml/NodeSeq.scala
@@ -9,6 +9,10 @@
package scala.xml ;
+object NodeSeq {
+ final val Empty = new NodeSeq { def theSeq = Nil; }
+}
+
/** a wrapper around Seq[Node] that adds XPath and comprehension methods */
abstract class NodeSeq extends Seq[Node] {