summaryrefslogtreecommitdiff
path: root/test.toc
blob: b1bcbc81c296952a695fe894efb5f4286b90f2df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// #C("#include <stdio.h>
// #define kasfdhkjasdfhjk ");

puti @= fn(x: int) {
	 #C("printf(\"%ld\\n\", (long)x)");
};

// foo @= fn(x:int) int {
// 	if x < 4 {
// 	return 7;
// 	} else {
// 	return 5;
// 	}
// 	4
// };

foo @= fn(x: int) int {
	 C := new(int, x);
	 i := 0;
	 while i < x {
	 C[i] = i;
	 i = i + 1;
	 }
	 total := 0;
	 while i < x {
	 total = total + C[i];
	 i = i + 1;
	 }
	 total
	
};

main @= fn() {
	 A : [foo(10)]int;
	 B : [foo(100)]int;
	 // C := new(int, 10);
	 // i := 0;
	 // while i < 10 {
	 // C[i] = 7;
	 // i = i + 1;
	 // }
	 // puti(C[9]);
};