1
2
3
assert(der('a', ZERO | ONE) == (ZERO | ZERO))
4
assert(der('a', (CHAR('a') | ONE) ~ CHAR('a')) == ALT((ONE | ZERO) ~ CHAR('a'), ONE))
5
assert(der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a'))))
6
assert(der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a'))))