testing4/re_test2.scala
author Christian Urban <urbanc@in.tum.de>
Thu, 29 Nov 2018 17:15:11 +0000
changeset 221 9e7897f25e13
parent 215 testing4/re1b_test.scala@438459a8e48b
child 300 72688efdf17c
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     3
assert(der('a', ZERO | ONE) == (ZERO | ZERO))
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     4
assert(der('a', (CHAR('a') | ONE) ~ CHAR('a')) == ALT((ONE | ZERO) ~ CHAR('a'), ONE))
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     5
assert(der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a'))))
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     6
assert(der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a'))))