main_testing3/re_test2.scala
changeset 475 59e005dcf163
parent 433 6af86ba1208f
--- a/main_testing3/re_test2.scala	Thu Nov 02 13:53:37 2023 +0000
+++ b/main_testing3/re_test2.scala	Thu Nov 02 23:34:53 2023 +0000
@@ -1,10 +1,14 @@
-import M3._
+
+def urbanmain() = {
+  import M3._
 
-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'))))
+  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"