summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-04-19 17:59:46 +0000
committermichelou <michelou@epfl.ch>2007-04-19 17:59:46 +0000
commit5cc62b4e5cfe4f37b7b30ae9d2cadcdbb406987e (patch)
tree6e6b95195d1582f69d4e56a85f90d3d5530608fe /src/library
parented8f3f0b9b31e75b14933e889d6aa105d2c0f0b7 (diff)
downloadscala-5cc62b4e5cfe4f37b7b30ae9d2cadcdbb406987e.tar.gz
scala-5cc62b4e5cfe4f37b7b30ae9d2cadcdbb406987e.tar.bz2
scala-5cc62b4e5cfe4f37b7b30ae9d2cadcdbb406987e.zip
updated tests for productElement/-Arity
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/collection/BitSet.scala6
-rw-r--r--src/library/scala/collection/mutable/FlatHashTable.scala10
-rw-r--r--src/library/scala/util/automata/DetWordAutom.scala8
-rw-r--r--src/library/scala/util/automata/Inclusion.scala12
-rw-r--r--src/library/scala/util/automata/NondetWordAutom.scala18
-rw-r--r--src/library/scala/util/automata/WordBerrySethi.scala28
-rw-r--r--src/library/scala/util/parsing/Parsers.scala12
-rw-r--r--src/library/scala/util/parsing/SimpleTokenizer.scala8
-rw-r--r--src/library/scala/xml/PrefixedAttribute.scala17
-rw-r--r--src/library/scala/xml/UnprefixedAttribute.scala10
-rw-r--r--src/library/scala/xml/parsing/FactoryAdapter.scala16
-rw-r--r--src/library/scala/xml/parsing/MarkupParser.scala33
12 files changed, 83 insertions, 95 deletions
diff --git a/src/library/scala/collection/BitSet.scala b/src/library/scala/collection/BitSet.scala
index 5cc6b66874..41863fe29b 100644
--- a/src/library/scala/collection/BitSet.scala
+++ b/src/library/scala/collection/BitSet.scala
@@ -151,7 +151,7 @@ abstract class BitSet extends Set[Int] {
val newarr = new Array[Int](length)
if (arr.length > 0)
arraycopy(this.arr, 0, newarr, 0, length)
- newarr;
+ newarr
}
/**
* @return a copy of the array underlying this bitset
@@ -163,9 +163,9 @@ abstract class BitSet extends Set[Int] {
@deprecated override def toArray[B >: Int]: Array[B] = {
val ret0 = underlying
val ret1 = new Array[B](ret0.length)
- for (val i <- 0.until(ret0.length))
+ for (i <- 0.until(ret0.length))
ret1(i) = (ret0(i) : Any).asInstanceOf[B]
ret1
}
- protected override def stringPrefix = "Set";
+ protected override def stringPrefix = "Set"
}
diff --git a/src/library/scala/collection/mutable/FlatHashTable.scala b/src/library/scala/collection/mutable/FlatHashTable.scala
index aeab7cd2ea..d968e97c8b 100644
--- a/src/library/scala/collection/mutable/FlatHashTable.scala
+++ b/src/library/scala/collection/mutable/FlatHashTable.scala
@@ -1,5 +1,5 @@
/* NSC -- new Scala compiler
- * Copyright 2005-2006 LAMP/EPFL
+ * Copyright 2005-2007 LAMP/EPFL
* @author Martin Odersky
*/
// $Id: HashSet.scala 9235 2006-11-13 14:59:18 +0000 (Mon, 13 Nov 2006) mihaylov $
@@ -94,7 +94,7 @@ trait FlatHashTable[A] {
h1 = (h1 + 1) % table.length
}
table(h0) = null
- tableSize = tableSize - 1
+ tableSize -= 1
if (tableDebug) checkConsistent()
return
}
@@ -123,13 +123,13 @@ trait FlatHashTable[A] {
while (i < oldtable.length) {
val entry = oldtable(i)
if (null != entry) addEntry(entry.asInstanceOf[A])
- i = i + 1
+ i += 1
}
if (tableDebug) checkConsistent()
}
private def checkConsistent() {
- for (val i <- 0 until table.length)
+ for (i <- 0 until table.length)
if (table(i) != null && !containsEntry(table(i).asInstanceOf[A]))
assert(false, i+" "+table(i)+" "+table.toString)
}
@@ -153,7 +153,7 @@ trait FlatHashTable[A] {
protected def clear() {
var i = table.length - 1
- while (i >= 0) { table(i) = null; i = i - 1 }
+ while (i >= 0) { table(i) = null; i -= 1 }
tableSize = 0
}
}
diff --git a/src/library/scala/util/automata/DetWordAutom.scala b/src/library/scala/util/automata/DetWordAutom.scala
index e0075e5bc8..fd267a6648 100644
--- a/src/library/scala/util/automata/DetWordAutom.scala
+++ b/src/library/scala/util/automata/DetWordAutom.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -64,11 +64,11 @@ abstract class DetWordAutom[T <: AnyRef] {
var j = 0; while( j < nstates ) {
if (j < finals.length)
map = map.update(j, finals(j))
- j = j + 1
+ j += 1
}
sb.append(map.toString())
sb.append(" delta=\n")
- for (val i <- 0 until nstates) {
+ for (i <- 0 until nstates) {
sb.append( i )
sb.append("->")
sb.append(delta(i).toString())
diff --git a/src/library/scala/util/automata/Inclusion.scala b/src/library/scala/util/automata/Inclusion.scala
index eb8beb47b3..ee5fe6100f 100644
--- a/src/library/scala/util/automata/Inclusion.scala
+++ b/src/library/scala/util/automata/Inclusion.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -29,9 +29,9 @@ trait Inclusion[A <: AnyRef] {
*/
def inclusion(dfa1: DetWordAutom[A], dfa2: DetWordAutom[A]) = {
- def encode(q1:Int, q2:Int) = 1 + q1 + q2 * dfa1.nstates
- def decode2(c:Int) = (c-1) / (dfa1.nstates) //integer division
- def decode1(c:Int) = (c-1) % (dfa1.nstates)
+ def encode(q1: Int, q2: Int) = 1 + q1 + q2 * dfa1.nstates
+ def decode2(c: Int) = (c-1) / (dfa1.nstates) //integer division
+ def decode1(c: Int) = (c-1) % (dfa1.nstates)
var q1 = 0 //dfa1.initstate; // == 0
var q2 = 0 //dfa2.initstate; // == 0
@@ -45,7 +45,7 @@ trait Inclusion[A <: AnyRef] {
mark(last) = max // mark (q1,q2)
while (current != 0 && result) {
//Console.println("current = [["+q1+" "+q2+"]] = "+current);
- for (val letter <- labels) {
+ for (letter <- labels) {
val r1 = dfa1.next(q1,letter)
val r2 = dfa2.next(q2,letter)
if (dfa1.isFinal(r1) && !dfa2.isFinal(r2))
diff --git a/src/library/scala/util/automata/NondetWordAutom.scala b/src/library/scala/util/automata/NondetWordAutom.scala
index 4580706031..3aa9febf6e 100644
--- a/src/library/scala/util/automata/NondetWordAutom.scala
+++ b/src/library/scala/util/automata/NondetWordAutom.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -66,8 +66,8 @@ abstract class NondetWordAutom[T <: AnyRef] {
/** returns a bitset with the next states for given state and label */
def next(Q: immutable.BitSet, a: T): immutable.BitSet = {
val x = new mutable.BitSet(nstates)
- for (val q <- Q) {
- for (val i <- next(q,a)) {
+ for (q <- Q) {
+ for (i <- next(q,a)) {
x += i
}
}
@@ -77,12 +77,12 @@ abstract class NondetWordAutom[T <: AnyRef] {
def nextDefault(Q: immutable.BitSet): immutable.BitSet = {
val x = new mutable.BitSet(nstates)
- for (val q <- Q) {
- for (val i <- default(q)) { //@todo: OR
+ for (q <- Q) {
+ for (i <- default(q)) { //@todo: OR
x += i
}
}
- x.toImmutable;
+ x.toImmutable
}
override def toString = {
@@ -94,11 +94,11 @@ abstract class NondetWordAutom[T <: AnyRef] {
var j = 0; while (j < nstates) {
if (isFinal(j))
map = map.update(j, finals(j));
- j = j + 1
+ j += 1
}
sb.append(map.toString)
sb.append(" delta=\n")
- for (val i <- 0 until nstates) {
+ for (i <- 0 until nstates) {
sb.append(" ")
sb.append( i )
sb.append("->")
diff --git a/src/library/scala/util/automata/WordBerrySethi.scala b/src/library/scala/util/automata/WordBerrySethi.scala
index 20b4edfc64..ee031d67c6 100644
--- a/src/library/scala/util/automata/WordBerrySethi.scala
+++ b/src/library/scala/util/automata/WordBerrySethi.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -123,11 +123,11 @@ abstract class WordBerrySethi extends BaseBerrySethi {
//@ifdef compiler if( label == Wildcard )
//@ifdef compiler defaultq.update(src, dest::defaultq( src ))
//@ifdef compiler else
- val q = deltaq( src );
+ val q = deltaq(src)
q.update(label, dest::(q.get(label) match {
case Some(x) => x
case _ => Nil
- }));
+ }))
}
protected def initialize(subexpr: Seq[RegExp]): Unit = {
@@ -157,7 +157,7 @@ abstract class WordBerrySethi extends BaseBerrySethi {
while (j < pos) {
deltaq(j) = new mutable.HashMap[_labelT,List[Int]]()
defaultq(j) = Nil
- j = j + 1
+ j += 1
}
}
@@ -175,7 +175,7 @@ abstract class WordBerrySethi extends BaseBerrySethi {
else
makeTransition( j, k, labelAt(k))
}
- j = j + 1
+ j += 1
}
}
@@ -203,7 +203,7 @@ abstract class WordBerrySethi extends BaseBerrySethi {
var i = 0
while (i < deltaq.length) {
delta1 = delta1.update(i, deltaq(i))
- i = i + 1
+ i += 1
}
val finalsArr = new Array[Int](pos)
@@ -213,7 +213,7 @@ abstract class WordBerrySethi extends BaseBerrySethi {
case Some(z) => z
case None => 0 // 0 == not final
};
- k = k + 1
+ k += 1
}
}
@@ -223,7 +223,7 @@ abstract class WordBerrySethi extends BaseBerrySethi {
{
var k = 0; while (k < initials.size) {
initialsArr(k) = it.next
- k = k + 1
+ k += 1
}
}
@@ -234,15 +234,15 @@ abstract class WordBerrySethi extends BaseBerrySethi {
val labels = delta1(k).keys
val hmap =
new mutable.HashMap[_labelT, immutable.BitSet]
- for (val lab <- labels) {
+ for (lab <- labels) {
val trans = delta1(k)
val x = new mutable.BitSet(pos)
- for (val q <- trans(lab))
+ for (q <- trans(lab))
x += q
hmap.update(lab, x.toImmutable)
}
deltaArr(k) = hmap
- k = k + 1
+ k += 1
}
}
val defaultArr = new Array[immutable.BitSet](pos)
@@ -250,10 +250,10 @@ abstract class WordBerrySethi extends BaseBerrySethi {
{
var k = 0; while(k < pos) {
val x = new mutable.BitSet(pos)
- for (val q <- defaultq(k))
+ for (q <- defaultq(k))
x += q
defaultArr(k) = x.toImmutable
- k = k + 1
+ k += 1
}
}
diff --git a/src/library/scala/util/parsing/Parsers.scala b/src/library/scala/util/parsing/Parsers.scala
index 37ff73ac7b..f046318c85 100644
--- a/src/library/scala/util/parsing/Parsers.scala
+++ b/src/library/scala/util/parsing/Parsers.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -57,7 +57,7 @@ abstract class Parsers {
}
def &&& [b](p: => Parser[b]): Parser[b] =
- for (val _ <- this; val x <- p) yield x
+ for (_ <- this; val x <- p) yield x
}
def not[a](p: Parser[a]) = new Parser[unit] {
@@ -75,11 +75,11 @@ abstract class Parsers {
rep1(p) ||| succeed(List())
def rep1[a](p: Parser[a]): Parser[List[a]] =
- for (val x <- p; val xs <- rep(p)) yield x :: xs
+ for (x <- p; val xs <- rep(p)) yield x :: xs
def repWith[a, b](p: Parser[a], sep: Parser[b]): Parser[List[a]] =
- for (val x <- p; val xs <- rep(sep &&& p)) yield x :: xs
+ for (x <- p; val xs <- rep(sep &&& p)) yield x :: xs
def opt[a](p: Parser[a]): Parser[List[a]] =
- (for (val x <- p) yield List(x)) ||| succeed(List())
+ (for (x <- p) yield List(x)) ||| succeed(List())
}
diff --git a/src/library/scala/util/parsing/SimpleTokenizer.scala b/src/library/scala/util/parsing/SimpleTokenizer.scala
index 760fdc6f92..483edd459e 100644
--- a/src/library/scala/util/parsing/SimpleTokenizer.scala
+++ b/src/library/scala/util/parsing/SimpleTokenizer.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,8 +11,6 @@
package scala.util.parsing
-import compat.StringBuilder
-
/** This class ...
*
* @author Burak Emir
@@ -27,7 +25,7 @@ class SimpleTokenizer(in: Iterator[char], delimiters: String) extends Iterator[S
private def delimArray: Array[boolean] = {
val ds = List.fromString(delimiters)
val da = new Array[boolean]((0 /: ds)(max) + 1)
- for (val ch <- ds) { da(ch) = true }
+ for (ch <- ds) { da(ch) = true }
da
}
diff --git a/src/library/scala/xml/PrefixedAttribute.scala b/src/library/scala/xml/PrefixedAttribute.scala
index 397a68507c..0ee62b9cd7 100644
--- a/src/library/scala/xml/PrefixedAttribute.scala
+++ b/src/library/scala/xml/PrefixedAttribute.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -11,10 +11,12 @@
package scala.xml
-import compat.StringBuilder
-
/** prefixed attributes always have a non-null namespace.
+ *
+ * @param pre ...
+ * @param key ...
* @param value the attribute value, which may not be null
+ * @param next ...
*/
class PrefixedAttribute(val pre: String,
val key: String,
@@ -77,16 +79,13 @@ class PrefixedAttribute(val pre: String,
sb.append(key)
sb.append('=')
val sb2 = new StringBuilder()
- for (val c <- value) {
- Utility.toXML(c, TopScope, sb2, true)
- }
+ for (c <- value) Utility.toXML(c, TopScope, sb2, true)
Utility.appendQuoted(sb2.toString(), sb)
}
- def wellformed(scope: NamespaceBinding): Boolean = {
+ def wellformed(scope: NamespaceBinding): Boolean =
(null == next(scope.getURI(pre), scope, key) &&
next.wellformed(scope))
- }
def remove(key: String) =
copy(next.remove(key))
diff --git a/src/library/scala/xml/UnprefixedAttribute.scala b/src/library/scala/xml/UnprefixedAttribute.scala
index 81d02c955f..4e4694fadb 100644
--- a/src/library/scala/xml/UnprefixedAttribute.scala
+++ b/src/library/scala/xml/UnprefixedAttribute.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -68,9 +68,7 @@ class UnprefixedAttribute(val key: String, val value: Seq[Node], next1: MetaData
sb.append(key)
sb.append('=')
val sb2 = new StringBuilder()
- for (val c <- value) {
- Utility.toXML(c, TopScope, sb2, true)
- }
+ for (c <- value) Utility.toXML(c, TopScope, sb2, true)
Utility.appendQuoted(sb2.toString(), sb)
}
@@ -78,7 +76,7 @@ class UnprefixedAttribute(val key: String, val value: Seq[Node], next1: MetaData
(null == next(null, scope, key)) && next.wellformed(scope)
def remove(key: String) =
- if(this.key == key) next else copy(next.remove(key))
+ if (this.key == key) next else copy(next.remove(key))
def remove(namespace: String, scope: NamespaceBinding, key: String): MetaData =
next.remove(namespace, scope, key)
diff --git a/src/library/scala/xml/parsing/FactoryAdapter.scala b/src/library/scala/xml/parsing/FactoryAdapter.scala
index 42b17a4ec7..733a2e0aa8 100644
--- a/src/library/scala/xml/parsing/FactoryAdapter.scala
+++ b/src/library/scala/xml/parsing/FactoryAdapter.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -13,14 +13,8 @@ package scala.xml.parsing
import java.io.{InputStream, Reader, File, FileDescriptor, FileInputStream}
import scala.collection.mutable.{HashMap,Stack}
-import compat.StringBuilder
-import org.xml.sax.Attributes
-import org.xml.sax.ContentHandler
-
-import org.xml.sax.ErrorHandler
-import org.xml.sax.Locator
-import org.xml.sax.InputSource
+import org.xml.sax.{Attributes, InputSource}
import org.xml.sax.SAXException
import org.xml.sax.SAXNotRecognizedException
@@ -97,7 +91,7 @@ abstract class FactoryAdapter extends DefaultHandler() {
buffer.append(ch(i))
ws = false
}
- i = i + 1
+ i += 1
}
} else { // compliant:report every character
buffer.append(ch, offset, length)
@@ -133,7 +127,7 @@ abstract class FactoryAdapter extends DefaultHandler() {
var m: MetaData = Null
var scpe = scopeStack.top
- for (val i <- List.range(0, attributes.getLength())) {
+ for (i <- List.range(0, attributes.getLength())) {
//val attrType = attributes.getType(i); // unused for now
val qname = attributes.getQName(i)
val value = attributes.getValue(i)
diff --git a/src/library/scala/xml/parsing/MarkupParser.scala b/src/library/scala/xml/parsing/MarkupParser.scala
index 771ec50790..a1c34f7287 100644
--- a/src/library/scala/xml/parsing/MarkupParser.scala
+++ b/src/library/scala/xml/parsing/MarkupParser.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.xml.parsing
-import compat.StringBuilder
import scala.io.Source
import scala.xml.dtd._
@@ -211,13 +210,13 @@ trait MarkupParser requires (MarkupParser with MarkupHandler) extends AnyRef wit
//Console.println("[MarkupParser::document] children now: "+children.toList);
var elemCount = 0;
var theNode: Node = null;
- for (val c <- children) c match {
+ for (c <- children) c match {
case _:ProcInstr => ;
case _:Comment => ;
case _:EntityRef => // todo: fix entities, shouldn't be "special"
reportSyntaxError("no entity references alllowed here");
case s:SpecialNode =>
- if(s.toString().trim().length() > 0) //non-empty text nodes not allowed
+ if (s.toString().trim().length() > 0) //non-empty text nodes not allowed
elemCount = elemCount + 2;
case m:Node =>
elemCount = elemCount + 1;
@@ -439,27 +438,27 @@ trait MarkupParser requires (MarkupParser with MarkupHandler) extends AnyRef wit
* see [15]
*/
def xComment: NodeSeq = {
- val sb: StringBuilder = new StringBuilder();
- xToken('-');
- xToken('-');
+ val sb: StringBuilder = new StringBuilder()
+ xToken('-')
+ xToken('-')
while (true) {
if (ch == '-' && { sb.append(ch); nextch; ch == '-' }) {
- sb.setLength(sb.length() - 1);
- nextch;
- xToken('>');
- return handle.comment(pos, sb.toString());
- } else sb.append(ch);
- nextch;
+ sb.setLength(sb.length() - 1)
+ nextch
+ xToken('>')
+ return handle.comment(pos, sb.toString())
+ } else sb.append(ch)
+ nextch
}
- throw FatalError("this cannot happen");
- };
+ throw FatalError("this cannot happen")
+ }
/* todo: move this into the NodeBuilder class */
def appendText(pos: Int, ts: NodeBuffer, txt: String): Unit = {
if (preserveWS)
ts &+ handle.text(pos, txt);
else
- for (val t <- TextBuffer.fromString(txt).toText) {
+ for (t <- TextBuffer.fromString(txt).toText) {
ts &+ handle.text(pos, t.text);
}
}