summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-11-26 10:26:42 +0000
committerpaltherr <paltherr@epfl.ch>2003-11-26 10:26:42 +0000
commit25016938dc4c3872cc4cb25c08a6f928a0d27b0d (patch)
treed27777602f50d987ff000c4999d686bbace59480
parentdaf8afbdbb71da0d3312a5e8065d6757208933a0 (diff)
downloadscala-25016938dc4c3872cc4cb25c08a6f928a0d27b0d.tar.gz
scala-25016938dc4c3872cc4cb25c08a6f928a0d27b0d.tar.bz2
scala-25016938dc4c3872cc4cb25c08a6f928a0d27b0d.zip
- Fixed dtd2scala for new import scheme
- Reenabled compilation of dtd2scala
-rw-r--r--Makefile2
-rw-r--r--sources/scala/tools/dtd2scala/DeclToScala.scala9
-rw-r--r--sources/scala/tools/dtd2scala/regexp/Parser.scala4
-rw-r--r--sources/scala/tools/dtd2scala/regexp/Scanner.scala2
4 files changed, 10 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index b17a8fa310..1018c6c634 100644
--- a/Makefile
+++ b/Makefile
@@ -176,7 +176,7 @@ all : system
all : interpreter
all : scaladoc
all : scalap
-#all : dtd2scala
+all : dtd2scala
all : scalac4ant
all : scalatest
all : library-doc
diff --git a/sources/scala/tools/dtd2scala/DeclToScala.scala b/sources/scala/tools/dtd2scala/DeclToScala.scala
index 55fbdf1619..f80d1c8376 100644
--- a/sources/scala/tools/dtd2scala/DeclToScala.scala
+++ b/sources/scala/tools/dtd2scala/DeclToScala.scala
@@ -1,11 +1,12 @@
-package scala.tools.dtd2scala ;
+import scalac.util.Name ;
+import scalac.ast.parser.Scanner ; /* for keywords */
+
+package scala.tools.dtd2scala {
import java.io.PrintWriter ;
import scala.collection.Map ;
import scala.collection.mutable.HashMap ;
-import scalac.util.Name ;
-import scalac.ast.parser.Scanner ; /* for keywords */
import scala.xml._ ;
import scala.xml.nobinding.{Element,XML} ;
@@ -187,3 +188,5 @@ private def cookedCap( raw:String ):String = {
private val toy:Scanner = new Scanner();
}
+
+}
diff --git a/sources/scala/tools/dtd2scala/regexp/Parser.scala b/sources/scala/tools/dtd2scala/regexp/Parser.scala
index dc55ff39d2..0a8e2d855a 100644
--- a/sources/scala/tools/dtd2scala/regexp/Parser.scala
+++ b/sources/scala/tools/dtd2scala/regexp/Parser.scala
@@ -31,7 +31,7 @@ object Parser with Scanner { // a bit too permissive concerning #PCDATA
private def seq = {
val f = factor;
if( token != COMMA ) f else {
- var fs:List[ RegExp ] = List( f );
+ var fs:List[ RegExp ] = f :: Nil;
while( token == COMMA ) { nextToken; fs = factor :: fs }
Seq( fs.reverse:_* );
}
@@ -41,7 +41,7 @@ object Parser with Scanner { // a bit too permissive concerning #PCDATA
private def factor:RegExp = {
var a = atomSuffix;
if( token != CHOICE ) a else {
- var as:List[ RegExp ] = List( a );
+ var as:List[ RegExp ] = a :: Nil;
while( token == CHOICE ) { nextToken; as = atomSuffix :: as; }
Alt( as.reverse:_* );
}
diff --git a/sources/scala/tools/dtd2scala/regexp/Scanner.scala b/sources/scala/tools/dtd2scala/regexp/Scanner.scala
index eca36fab12..1f3da8a4ee 100644
--- a/sources/scala/tools/dtd2scala/regexp/Scanner.scala
+++ b/sources/scala/tools/dtd2scala/regexp/Scanner.scala
@@ -52,7 +52,7 @@ class Scanner with Tokens {
}
private def readValue = {
- var buf = List( c ); next; while ( isIdentChar ) { buf = c::buf; next }
+ var buf = c :: Nil; next; while ( isIdentChar ) { buf = c::buf; next }
value = buf.foldLeft ("") { ( s, c ) => c+s };
}