summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-05-17 22:00:50 -0700
committerOri Bernstein <ori@eigenstate.org>2016-05-17 22:00:50 -0700
commit7aac15b2bfcc5eec279aa14f9f199685f9d7e0d9 (patch)
treec9434a55ea6850aee7103f608c6333cfe3148d60 /test
parentc96238b89583ed91e92ad909c507797d00015e95 (diff)
downloadmc-7aac15b2bfcc5eec279aa14f9f199685f9d7e0d9.tar.gz
New syntax for casts.
Diffstat (limited to 'test')
-rw-r--r--test/basicfloat.myr2
-rw-r--r--test/bigliteral.myr2
-rw-r--r--test/doublecall.myr2
-rw-r--r--test/fncast.myr4
-rw-r--r--test/log-and.myr2
-rw-r--r--test/log-or.myr2
-rw-r--r--test/mul8.myr2
-rw-r--r--test/sqrt.myr5
-rw-r--r--test/str.myr2
-rw-r--r--test/swidencast.myr4
-rw-r--r--test/traitimpl.myr2
-rw-r--r--test/trunccast.myr4
-rw-r--r--test/zwidencast.myr4
13 files changed, 20 insertions, 17 deletions
diff --git a/test/basicfloat.myr b/test/basicfloat.myr
index 5243a67..aeb481d 100644
--- a/test/basicfloat.myr
+++ b/test/basicfloat.myr
@@ -6,5 +6,5 @@ const get42 = {
/* basic sanity check on floating point operations. should return 84. */
const main = {
- std.exit((42.0 + get42()) castto(int))
+ std.exit((42.0 + get42() : int))
}
diff --git a/test/bigliteral.myr b/test/bigliteral.myr
index 5a04ffa..fe1b8f9 100644
--- a/test/bigliteral.myr
+++ b/test/bigliteral.myr
@@ -1,5 +1,5 @@
use std
const main = {
- std.put("{}\n", 34359738368 castto(int64))
+ std.put("{}\n", (34359738368 : int64))
}
diff --git a/test/doublecall.myr b/test/doublecall.myr
index 2248ee7..aa9f78a 100644
--- a/test/doublecall.myr
+++ b/test/doublecall.myr
@@ -9,5 +9,5 @@ const a = {
}
const b = {
- -> 33 castto(int16)
+ -> (33 : int16)
}
diff --git a/test/fncast.myr b/test/fncast.myr
index 374dfe1..6ea40a6 100644
--- a/test/fncast.myr
+++ b/test/fncast.myr
@@ -9,8 +9,8 @@ const main = {
envfn = {
ptr = ptr
}
- ptr = fn castto(byte#)
- ptr = envfn castto(byte#)
+ ptr = (fn : byte#)
+ ptr = (envfn : byte#)
std.put("ok\n")
}
diff --git a/test/log-and.myr b/test/log-and.myr
index 694c380..e29d993 100644
--- a/test/log-and.myr
+++ b/test/log-and.myr
@@ -1,5 +1,5 @@
use std
/* checks that evaluating a logical and to a bool works. should return 0. */
const main = {
- std.exit((0 && 1) castto(int))
+ std.exit((0 && 1 : int))
}
diff --git a/test/log-or.myr b/test/log-or.myr
index 7adef8b..c0f4106 100644
--- a/test/log-or.myr
+++ b/test/log-or.myr
@@ -1,5 +1,5 @@
use std
/* checks that evaluating a logical or works. exits with 1. */
const main = {
- std.exit((0 || 1) castto(int))
+ std.exit((0 || 1 : int))
}
diff --git a/test/mul8.myr b/test/mul8.myr
index 0bd07c0..8ee67cf 100644
--- a/test/mul8.myr
+++ b/test/mul8.myr
@@ -5,5 +5,5 @@ const f = { -> int8
-> 3
}
const main = {
- std.exit(((a*f()) castto(int)))
+ std.exit(((a*f() : int)))
}
diff --git a/test/sqrt.myr b/test/sqrt.myr
index 42d89b1..98b80ea 100644
--- a/test/sqrt.myr
+++ b/test/sqrt.myr
@@ -28,6 +28,9 @@ const sqrt = {x : flt64
}
const main = {
- std.exit(sqrt(20.0) castto(int))
+ var r
+
+ r = (sqrt(20.0) : int)
+ std.exit(r)
}
diff --git a/test/str.myr b/test/str.myr
index bcb8eff..87502c5 100644
--- a/test/str.myr
+++ b/test/str.myr
@@ -5,5 +5,5 @@ const main = {
var str
str = "asdf"
- std.exit(str[3] castto(int))
+ std.exit((str[3] : int))
}
diff --git a/test/swidencast.myr b/test/swidencast.myr
index 4148540..9562edc 100644
--- a/test/swidencast.myr
+++ b/test/swidencast.myr
@@ -5,6 +5,6 @@ const main = {
var v : int32
u = 99
- v = u castto(int32)
- std.exit(v castto(int))
+ v = (u : int32)
+ std.exit((v : int))
}
diff --git a/test/traitimpl.myr b/test/traitimpl.myr
index 6299b43..e0d1eca 100644
--- a/test/traitimpl.myr
+++ b/test/traitimpl.myr
@@ -29,7 +29,7 @@ generic foo = {x : @a::frobable
const main = {
var a, b, c
a = foo(123)
- b = foo(11 castto(int16))
+ b = foo((11 : int16))
c = frob("meeeeeeh")
std.put("{},{},{}\n", a, b, c)
}
diff --git a/test/trunccast.myr b/test/trunccast.myr
index 11e96e8..14f283e 100644
--- a/test/trunccast.myr
+++ b/test/trunccast.myr
@@ -5,6 +5,6 @@ const main = {
var y : int32
y = 9999
- x = y castto(uint8)
- std.exit((x % 73) castto(int))
+ x = (y : uint8)
+ std.exit((x % 73 : int))
}
diff --git a/test/zwidencast.myr b/test/zwidencast.myr
index 2b572da..00d1086 100644
--- a/test/zwidencast.myr
+++ b/test/zwidencast.myr
@@ -5,6 +5,6 @@ const main = {
var v : uint32
u = 99
- v = u castto(uint32)
- std.exit(v castto(int))
+ v = (u : uint32)
+ std.exit((v : int))
}