progs/scala/tests.scala
changeset 196 5fa8344a5176
parent 195 c2d36c3cf8ad
child 197 a35041d5707c
--- a/progs/scala/tests.scala	Fri Jun 10 23:53:46 2016 +0100
+++ b/progs/scala/tests.scala	Sat Jun 11 13:28:45 2016 +0100
@@ -203,7 +203,7 @@
 println(Parser("a|(bc)*").Regex())
 
 
-def process(line: String) : String = {
+def process_line(line: String) : String = {
   if (line.head == '#') "#" else
     {
       val line_split = line.split("\\t+")
@@ -226,18 +226,21 @@
     }
 }
 
-
-//val filename = "../tests/forced-assoc.txt"
-//val filename = "../tests/left-assoc.txt"
-//val filename = "../tests/right-assoc.txt"
-//val filename = "../tests/class.txt"
-//val filename = "../tests/basic3.txt"
-//val filename = "../tests/totest.txt"
-//val filename = "../tests/repetition2.txt"
-//val filename = "../tests/osx-bsd-critical.txt"
-val filename = "../tests/nullsub3.txt"
-val filelines : List[String] = Source.fromFile(filename).getLines.toList
+def process_file(name : String) : Unit = {
+  println("\nProcessing " + name)
+  val filelines : List[String] = Source.fromFile(name).getLines.toList
+  filelines.foreach((s: String) => print(process_line(s)))
+}
 
 
-filelines.foreach((s: String) => print(process(s)))
+val files = List("../tests/forced-assoc.txt",
+                 "../tests/left-assoc.txt",
+                 //"../tests/right-assoc.txt",
+                 "../tests/class.txt",
+                 "../tests/basic3.txt",
+                 "../tests/totest.txt",
+                 "../tests/repetition2.txt",
+                 "../tests/osx-bsd-critical.txt")
 
+files.foreach(process_file(_))
+