# HG changeset patch # User Christian Urban # Date 1476863210 -3600 # Node ID 921fdd17d2b807d65c7f1f95700e98c38ffbcfe8 # Parent 2fddf8ab744f3882a532465bfbaa9f330dc3878e updated diff -r 2fddf8ab744f -r 921fdd17d2b8 progs/re3a.scala --- a/progs/re3a.scala Tue Oct 18 20:39:54 2016 +0100 +++ b/progs/re3a.scala Wed Oct 19 08:46:50 2016 +0100 @@ -35,7 +35,7 @@ case NTIMES(r1, i) => if (i == 0) ZERO else if (nullable(r1)) SEQ(der(c, r1), UPNTIMES(r1, i - 1)) - else SEQ(der(c, r1), NTIMES(r1, i)) + else SEQ(der(c, r1), NTIMES(r1, i - 1)) case UPNTIMES(r1, i) => if (i == 0) ZERO else SEQ(der(c, r1), UPNTIMES(r1, i - 1)) @@ -68,7 +68,6 @@ // main matcher function def matcher(r: Rexp, s: String) : Boolean = nullable(ders(s.toList, r)) - //one or zero def OPT(r: Rexp) = ALT(r, ONE)