regexp3.scala
changeset 39 e5fb17c02508
parent 29 774007c4b1b3
--- a/regexp3.scala	Wed Oct 17 08:24:00 2012 +0100
+++ b/regexp3.scala	Wed Oct 17 08:47:01 2012 +0100
@@ -48,8 +48,7 @@
 // derivative of a regular expression w.r.t. a character
 def der (c: Char, r: Rexp) : Rexp = r match {
   case NULL => NULL
-  case EMPTY => NULL
-  case CHAR(d) => if (c == d) EMPTY else NULL
+  case EMPTY => NULL  case CHAR(d) => if (c == d) EMPTY else NULL
   case ALT(r1, r2) => ALT(der(c, r1), der(c, r2))
   case SEQ(r1, r2) => 
     if (nullable(r1)) ALT(SEQ(der(c, r1), r2), der(c, r2))