forked from c2lang/c2compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathccode.c2
55 lines (47 loc) · 750 Bytes
/
ccode.c2
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
44
45
46
47
48
49
50
51
52
53
54
module ccode1;
import stdio;
import ccode2;
type Point struct {
i32 x;
u16 y;
}
/*
Point[+] points;
points += { 1, 2 }
points += { 2, 0 }
points += { 4, 3 }
points += { 6, 4 }
points += { 8, 1 }
*/
public func i32 main(i32 argc, i8*[] argv) {
func1();
func2();
return ccode2.myfunction();
}
public func i32 func2() {
i32 a = 3;
do {
a--;
stdio.puts("voila");
} while(a > 0);
return 0;
}
func void func1() {
i32 a = 'a';
i32[2] aa = { 1, 2}
u16 b;
{
i32 c;
}
if (a++ == 10 + 2 * 8) {
stdio.printf("hello world\n");
goto out;
} else {
stdio.printf("FooBarFaa!\n");
}
while (a >= 0) {
break;
}
out:
return;
}