summaryrefslogtreecommitdiff
path: root/test.toc
blob: 864d7a9950bef5025eae9da3d96ac060aaab7812 (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
puti ::= fn(x: int) {
	 #C("printf(\"%ld\\n\", (long)x);
");
};
putf ::= fn(x: float) {
	 #C("printf(\"%f\\n\", (double)x);
");
};

foo ::= fn(x ::= 5) (int, int) {
x, 2*x
};

main ::= fn() {
	 puti(f(3));
	 puti(f(7));
	 puti(f(4));

	 f ::= fn(x ::= foo()) y := x + 1 {  };

	 r ::= f(3);
	 puti(r);
	 s ::= f(7);
	 puti(s);
	 t ::= f(4);
	 puti(t);
	 
};