main_marking3/re_test4.scala
changeset 463 0315d9983cd0
parent 424 daf561a83ba6
--- a/main_marking3/re_test4.scala	Sun Jan 15 10:58:13 2023 +0000
+++ b/main_marking3/re_test4.scala	Sat Mar 11 22:01:53 2023 +0000
@@ -1,19 +1,5 @@
 import M3._
 
-val EVIL_urban = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))
-
-assert(ders(("a" * 5).toList, EVIL_urban) == SEQ(SEQ(STAR(CHAR('a')),STAR(STAR(CHAR('a')))),CHAR('b')))
-assert(ders(List('b'), EVIL_urban) == ONE)
-assert(ders(List('b','b'), EVIL_urban) == ZERO)
-assert(matcher(EVIL_urban, "a" * 5 ++ "b") == true)
-assert(matcher(EVIL_urban, "a" * 50 ++ "b") == true)
-assert(matcher(EVIL_urban, "a" * 50) == false)
-assert(matcher(EVIL_urban, "b") == true)
-assert(matcher(EVIL_urban, "bb") == false)
-assert(matcher("abc", "abc") == true)
-assert(matcher("abc", "ab") == false)
-assert(matcher(("ab" | "a") ~ (ONE | "bc"), "abc") == true)
-assert(matcher(ONE, "") == true)
-assert(matcher(ZERO, "") == false)
-assert(matcher(ONE | CHAR('a'), "") == true)
-assert(matcher(ONE | CHAR('a'), "a") == true)
+assert(denest(List(ONE, ZERO, ALTs(List(ONE, CHAR('a'))))) 
+   == List(ONE, ONE, CHAR('a')))
+assert(denest(List(ONE ~ ONE, ZERO, ZERO | ONE)) == List(ONE ~ ONE, ZERO, ONE))