progs/re3.scala
changeset 440 e14cd32ad497
parent 434 8664ff87cd77
child 441 028816884f70
--- a/progs/re3.scala	Mon Oct 03 20:35:25 2016 +0100
+++ b/progs/re3.scala	Tue Oct 04 12:00:23 2016 +0100
@@ -29,7 +29,7 @@
   case SEQ(r1, r2) => 
     if (nullable(r1)) ALT(SEQ(der(c, r1), r2), der(c, r2))
     else SEQ(der(c, r1), r2)
-  case STAR(r) => SEQ(der(c, r), STAR(r))
+  case STAR(r1) => SEQ(der(c, r1), STAR(r1))
   case NTIMES(r, i) => 
     if (i == 0) ZERO else SEQ(der(c, r), NTIMES(r, i - 1))
 }
@@ -68,7 +68,7 @@
 
 //evil regular expressions
 def EVIL1(n: Int) = SEQ(NTIMES(OPT(CHAR('a')), n), NTIMES(CHAR('a'), n))
-val EVIL2 = SEQ(STAR(CHAR('a')), CHAR('b'))
+val EVIL2 = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))
 
 
 def time_needed[T](i: Int, code: => T) = {