summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-10-28 15:39:01 -0400
committerOri Bernstein <ori@eigenstate.org>2013-10-28 15:39:01 -0400
commit89e514d5355f9036a30c4a41cacc465e5999aa76 (patch)
treef6402fddce8bde453291627cdd4d8db2ad0fd59e /test
parent682c4ce6114cb44e2ad95a75269585f6e1da8150 (diff)
downloadmc-89e514d5355f9036a30c4a41cacc465e5999aa76.tar.gz
Streamline syntax.
Move from: match foo bar: action ;; baz: action ;; To: match foo | bar: action | baz: action ;;
Diffstat (limited to 'test')
-rw-r--r--test/catfile.myr4
-rw-r--r--test/genericmatch.myr4
-rw-r--r--test/genericret.myr2
-rw-r--r--test/generictype.myr4
-rw-r--r--test/infer-named.myr4
-rw-r--r--test/matchargunion.myr16
-rw-r--r--test/matcharray.myr5
-rw-r--r--test/matchbind.myr16
-rw-r--r--test/matchconst.myr6
-rw-r--r--test/matchint.myr24
-rw-r--r--test/matchstruct.myr8
-rw-r--r--test/matchtup.myr4
-rw-r--r--test/matchunion.myr16
-rw-r--r--test/matchunion_sl.myr15
-rw-r--r--test/stdopt-mk.myr4
-rw-r--r--test/stdopt-none.myr4
-rw-r--r--test/stdopt-some.myr4
17 files changed, 46 insertions, 94 deletions
diff --git a/test/catfile.myr b/test/catfile.myr
index d9e49a1..1500be7 100644
--- a/test/catfile.myr
+++ b/test/catfile.myr
@@ -6,8 +6,8 @@ const main = {args : byte[:][:]
r = std.slurp("data/catfile-in")
match r
- `std.Success dat: std.write(1, dat);;
- `std.Failure msg: std.put("Failed to read file: %s\n", msg);;
+ | `std.Success dat: std.write(1, dat)
+ | `std.Failure msg: std.put("Failed to read file: %s\n", msg)
;;
-> 0
}
diff --git a/test/genericmatch.myr b/test/genericmatch.myr
index fdc4666..6d582e7 100644
--- a/test/genericmatch.myr
+++ b/test/genericmatch.myr
@@ -7,7 +7,7 @@ type t(@a) = union
const main = {
match `Foo 123
- `Foo a: -> 0xf;;
- `Bar: -> 0x0;;
+ | `Foo a: -> 0xf
+ | `Bar: -> 0x0
;;
}
diff --git a/test/genericret.myr b/test/genericret.myr
index 5c292a7..7a597a7 100644
--- a/test/genericret.myr
+++ b/test/genericret.myr
@@ -11,7 +11,7 @@ const f = {-> t(int)
const main = {
match f()
- `None: -> 42;;
+ | `None: -> 42
;;
-> 0
}
diff --git a/test/generictype.myr b/test/generictype.myr
index 4b9c696..ae3c148 100644
--- a/test/generictype.myr
+++ b/test/generictype.myr
@@ -11,8 +11,8 @@ const main = {
v = `Some 123
match v
- `None: -> 1;;
- `Some 123: -> 0;;
+ | `None: -> 1
+ | `Some 123: -> 0
;;
-> 60
}
diff --git a/test/infer-named.myr b/test/infer-named.myr
index 002cc97..b2e517d 100644
--- a/test/infer-named.myr
+++ b/test/infer-named.myr
@@ -14,8 +14,8 @@ const main = {
v = f(99)
match v
- `Foo: -> 1;;
- `Bar x: -> x;;
+ | `Foo: -> 1
+ | `Bar x: -> x
;;
-> 2
}
diff --git a/test/matchargunion.myr b/test/matchargunion.myr
index 933b52e..5d3ae53 100644
--- a/test/matchargunion.myr
+++ b/test/matchargunion.myr
@@ -12,18 +12,10 @@ const main = {
v = `Int 123
match v
- `Int 127:
- -> 42
- ;;
- `Int 123:
- -> 69
- ;;
- `Chr 'a':
- -> 4
- ;;
- `Nil:
- -> 6
- ;;
+ | `Int 127: -> 42
+ | `Int 123: -> 69
+ | `Chr 'a': -> 4
+ | `Nil: -> 6
;;
}
diff --git a/test/matcharray.myr b/test/matcharray.myr
index 67e8efe..38e3688 100644
--- a/test/matcharray.myr
+++ b/test/matcharray.myr
@@ -4,10 +4,9 @@ const main = {
var v = [2, 40, 10]
match v
- [x, y, 10]:
+ | [x, y, 10]:
-> x + y
- ;;
- _: std.die("Wat");;
+ | _: std.die("Wat")
;;
-> 0
}
diff --git a/test/matchbind.myr b/test/matchbind.myr
index f1bb52d..9465d6c 100644
--- a/test/matchbind.myr
+++ b/test/matchbind.myr
@@ -12,18 +12,10 @@ const main = {
v = `Int 8
match v
- `Int 127:
- -> 42
- ;;
- `Int x:
- -> x
- ;;
- `Chr 'a':
- -> 4
- ;;
- `Nil:
- -> 6
- ;;
+ | `Int 127: -> 42
+ | `Int x: -> x
+ | `Chr 'a': -> 4
+ | `Nil: -> 6
;;
}
diff --git a/test/matchconst.myr b/test/matchconst.myr
index 6dd68e5..fad888b 100644
--- a/test/matchconst.myr
+++ b/test/matchconst.myr
@@ -11,8 +11,8 @@ const main = {
v = 8
match v
- Ca: -> 123 ;;
- Cb: -> 88 ;;
- Cc: -> 42 ;;
+ | Ca: -> 123
+ | Cb: -> 88
+ | Cc: -> 42
;;
}
diff --git a/test/matchint.myr b/test/matchint.myr
index fb9d63f..b198d9d 100644
--- a/test/matchint.myr
+++ b/test/matchint.myr
@@ -5,23 +5,11 @@ const main = {
v = 12
match 12
- 1:
- -> 42
- ;;
- 2:
- -> 81
- ;;
- 3:
- -> 123
- ;;
- 4:
- -> 99
- ;;
- 12:
- -> 84
- ;;
- 6:
- -> 18
- ;;
+ | 1: -> 42
+ | 2: -> 81
+ | 3: -> 123
+ | 4: -> 99
+ | 12: -> 84
+ | 6: -> 18
;;
}
diff --git a/test/matchstruct.myr b/test/matchstruct.myr
index 38bc5e0..e6bde0f 100644
--- a/test/matchstruct.myr
+++ b/test/matchstruct.myr
@@ -13,12 +13,10 @@ const main = {
v.v2 = 40
v.v3 = 10
match v
- [.v1 = x,
- .v2 = y,
- .v3 = 10]:
+ | [.v1 = x, .v2 = y, .v3 = 10]:
-> x + y
- ;;
- _: std.die("Wat");;
+ | _:
+ std.die("Wat")
;;
-> 0
}
diff --git a/test/matchtup.myr b/test/matchtup.myr
index 9515de9..85e3a10 100644
--- a/test/matchtup.myr
+++ b/test/matchtup.myr
@@ -4,8 +4,8 @@ const main = {
var v = (1, 2)
match v
- (1, x): -> 40 + x;;
- _: std.die("Wat");;
+ | (1, x): -> 40 + x
+ | _: std.die("Wat")
;;
-> 0
}
diff --git a/test/matchunion.myr b/test/matchunion.myr
index 734aa95..8eb1d77 100644
--- a/test/matchunion.myr
+++ b/test/matchunion.myr
@@ -13,17 +13,9 @@ const main = {
v = `Foo
match v
- `Bar:
- -> 42
- ;;
- `Baz:
- -> 81
- ;;
- `Foo:
- -> 84
- ;;
- `Quux:
- -> 123
- ;;
+ | `Bar: -> 42
+ | `Baz: -> 81
+ | `Foo: -> 84
+ | `Quux: -> 123
;;
}
diff --git a/test/matchunion_sl.myr b/test/matchunion_sl.myr
index c1fbf83..54ba664 100644
--- a/test/matchunion_sl.myr
+++ b/test/matchunion_sl.myr
@@ -12,18 +12,9 @@ const main = {
v = `Str "foo"
match v
- /*
- `Int 127:
- -> 42
- ;;
- */
- `Str s:
- std.put("%s\n", s)
- ;;
- /*
- `Nil:
- ;;
- */
+ | `Int 127: -> 42
+ | `Str s: std.put("%s\n", s)
+ | `Nil:
;;
-> 0
}
diff --git a/test/stdopt-mk.myr b/test/stdopt-mk.myr
index 770f986..dc97f7f 100644
--- a/test/stdopt-mk.myr
+++ b/test/stdopt-mk.myr
@@ -13,8 +13,8 @@ const main = {
v = f(123)
match v
- `std.Some x: -> x;;
- `std.None: -> 123;;
+ | `std.Some x: -> x
+ | `std.None: -> 123
;;
}
diff --git a/test/stdopt-none.myr b/test/stdopt-none.myr
index 3f2f6cd..62ec5e4 100644
--- a/test/stdopt-none.myr
+++ b/test/stdopt-none.myr
@@ -6,8 +6,8 @@ const f = {
const main = {
match f()
- `std.Some x: -> x;;
- `std.None: -> 42;;
+ | `std.Some x: -> x
+ | `std.None: -> 42
;;
}
diff --git a/test/stdopt-some.myr b/test/stdopt-some.myr
index 78a9fe4..179dc8e 100644
--- a/test/stdopt-some.myr
+++ b/test/stdopt-some.myr
@@ -2,8 +2,8 @@ use std
const main = {
match `std.Some 42
- `std.Some x: -> x;;
- `std.None: -> 1;;
+ | `std.Some x: -> x
+ | `std.None: -> 1
;;
}