main_testing3/re_test2.scala
changeset 433 6af86ba1208f
parent 403 ffce7b61b446
child 475 59e005dcf163
--- a/main_testing3/re_test2.scala	Thu Nov 03 11:30:09 2022 +0000
+++ b/main_testing3/re_test2.scala	Tue Nov 08 00:27:47 2022 +0000
@@ -1,12 +1,12 @@
 import M3._
 
-assert(der('a', ZERO | ONE) == (ZERO | ZERO))
-assert(der('a', (CHAR('a') | ONE) ~ CHAR('a')) == ALT((ONE | ZERO) ~ CHAR('a'), ONE))
+assert(der('a', ZERO | ONE) == ALT(ZERO, ZERO))
+assert(der('a', (CHAR('a') | ONE) ~ CHAR('a')) == ALTs(List(SEQ(ALT(ONE, ZERO), CHAR('a')), SEQs(List(ONE)))))
 assert(der('a', (CHAR('a') | CHAR('a')) ~ CHAR('a')) == (ONE | ONE) ~ CHAR('a'))
 assert(der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a'))))
 assert(der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a'))))
 
-
+/*
 val r0_urban = "a" ~ "b" ~ "c"
 assert(der('a', r0_urban) == (ONE ~ "b") ~ "c")
 assert(der('b', r0_urban) == (ZERO ~ "b") ~ "c")
@@ -23,3 +23,4 @@
 assert(der('a', r2_urban) == ((((ZERO ~ "b") | ZERO) ~ "c") | ZERO))
 assert(der('b', r2_urban) == ((((ZERO ~ "b") | ZERO) ~ "c") | ZERO))
 assert(der('c', r2_urban) == ((((ZERO ~ "b") | ZERO) ~ "c") | ONE))
+*/