diff options
author | Ori Bernstein <ori@eigenstate.org> | 2012-06-30 18:46:38 -0400 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2012-06-30 18:46:55 -0400 |
commit | dfe3ca01782c70e9daf16165441af0eba8cfda8d (patch) | |
tree | 44906171daa76a75766a608b38e0696e4b4dfd5f /test | |
parent | 31d5350f573cf2b2c176082ae26de473ee1f885c (diff) | |
download | mc-dfe3ca01782c70e9daf16165441af0eba8cfda8d.tar.gz |
Add parenthesized submatches.
This allows clear, unambiguous sub-patterns.
Diffstat (limited to 'test')
-rw-r--r-- | test/matchbind.myr | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/matchbind.myr b/test/matchbind.myr new file mode 100644 index 0000000..8d56185 --- /dev/null +++ b/test/matchbind.myr @@ -0,0 +1,26 @@ +type u = union + `Int int + `Chr char + `Nil +;; + +const main = { + var v + + v = `Int 11 + match v + `Int 127: + -> 42 + ;; + `Int (var x): + -> x + ;; + `Chr 'a': + -> 4 + ;; + `Nil: + -> 6 + ;; + ;; +} + |