blob: 143dc0b95306083b22a6e356a7319ae1484dad40 (
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
|
puti ::= fn(x: int) {
#C("printf(\"%ld\\n\", (long)x);
");
};
putf ::= fn(x: float) {
#C("printf(\"%f\\n\", (double)x);
");
};
main ::= fn() {
puti(f(3));
puti(f(7));
puti(f(3,4));
// TODO: semiconst breaks this for some reason
f ::= fn(x :: int, y := x) int { y };
r ::= f(3);
puti(r);
s ::= f(7);
puti(s);
t ::= f(3,4);
puti(t);
};
|