summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-12-06 09:36:23 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2019-12-06 09:36:23 -0500
commit4d4ff133fb6b0f9bcd45a9598e779f1a45e8f8cc (patch)
treec3ab1f6bfbe160031621212d8de3c19373355e29 /test.toc
parent5df057ab76a7ed65c5312e156dccd2982a808cb7 (diff)
@ => :: (looks nicer)
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc26
1 files changed, 13 insertions, 13 deletions
diff --git a/test.toc b/test.toc
index 43db0c9..0cb9375 100644
--- a/test.toc
+++ b/test.toc
@@ -1,21 +1,21 @@
-puti @= fn(x: int) {
+puti ::= fn(x: int) {
#C("printf(\"%ld\\n\", (long)x);
");
};
-// putf @= fn(x: float) {
+// putf ::= fn(x: float) {
// #C("printf(\"%f\\n\", (double)x);
// ");
// };
-Arr @= fn (t @ Type) Type {
+Arr ::= fn (t :: Type) Type {
struct {
data : []t;
len, cap : int;
}
};
-// todo: test that t @ type doesn't cause problems
-arr_add @= fn(t @ Type, a : &Arr(t), x : t) {
+// todo: test that t :: type doesn't cause problems
+arr_add ::= fn(t :: Type, a : &Arr(t), x : t) {
if a.len >= a.cap {
a.cap = a.cap * 2 + 2;
new_data := new(t, a.cap);
@@ -30,24 +30,24 @@ arr_add @= fn(t @ Type, a : &Arr(t), x : t) {
-main @= fn() {
+main ::= fn() {
arr : Arr(int);
- arr_add(int, &arr, 5);
- arr_add(int, &arr, 10);
- arr_add(int, &arr, 20);
+ each i := 1..100 {
+ arr_add(int, &arr, i*i);
+ }
each i := 0..arr.len - 1 {
puti(arr.data[i]);
}
};
-// t @= fn(x @ Type) Type { struct { t: x; } };
+// t ::= fn(x :: Type) Type { struct { t: x; } };
// // pass the wrong thing to t, and the error is in the wrong place
-// f @= fn(x: t(int)) {};
+// f ::= fn(x: t(int)) {};
-// f @= fn(t @ Type, x : t) {
+// f ::= fn(t :: Type, x : t) {
// };
-// main @= fn() {
+// main ::= fn() {
// f(int,3);
// }; \ No newline at end of file