summaryrefslogtreecommitdiff
path: root/tests/init.toc
blob: 92fb9ed36ee26e17c621e6e8a96c96377b43523f (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
#include "std/io.toc";

total : int;

init ::= fn(x: int) {
	if #builtin("compiling") { return; }
	writes("Initializing... ");
	writei(x);
	puts("% complete");
	total += x;
}


main ::= fn() {
	writes("hello from main. total is ");
	puti(total);
}

#init init(0);
#init init(10);
#init init(22);
#init init(44);
#init init(88);
#init for i := 89..100 {init(i);}