progs/re1.scala
changeset 119 a6684e8961d0
parent 117 25999de692b2
child 258 1e4da6d2490c
--- a/progs/re1.scala	Mon Sep 30 20:03:41 2013 +0100
+++ b/progs/re1.scala	Tue Oct 01 23:59:36 2013 +0100
@@ -52,7 +52,7 @@
 
 //example
 //val r = STAR(ALT(SEQ(CHAR('a'), CHAR('b')), CHAR('b')))
-//der('b', r)
+//der('a', r)
 //der('b', r)
 
 //one or zero
@@ -65,7 +65,7 @@
   case n => SEQ(r, NTIMES(r, n - 1))
 }
 
-def RTEST(n: Int) = SEQ(NTIMES(OPT("a"), n), NTIMES("a", n))
+def EVIL(n: Int) = SEQ(NTIMES(OPT("a"), n), NTIMES("a", n))
 
 def time_needed[T](i: Int, code: => T) = {
   val start = System.nanoTime()
@@ -75,7 +75,7 @@
 }
 
 for (i <- 1 to 29) {
-  println(i + ": " + "%.5f".format(time_needed(1, matcher(RTEST(i), "a" * i))))
+  println(i + ": " + "%.5f".format(time_needed(1, matcher(EVIL(i), "a" * i))))
 }