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
|
// io ::= pkg "std/io";
// main ::= fn() {
// io.puts("Hello, world!");
// };
<<<<<<< HEAD
foo ::= fn(bar :: int = #foreign "X") {
};
stdout :: &u8 = #foreign "stdout";
fwrite :: fn(&u8, u64, u64, &u8) = #foreign "fwrite";
puts ::= fn(x : []char) {
// NOTE: removing brackets here causes error! this shouldn't happen!
fwrite((&x[0]) as (&u8), 1, x.len as u64, stdout);
};
main ::= fn() {
puts("Hello, world!\n");
};
=======
stdout :: &u8 = #foreign "stdout";
fwrite :: fn(&u8, u64, u64, &u8) = #foreign "fwrite";
puts ::= fn(x : []char) {
// NOTE: removing brackets here causes error! this shouldn't happen!
fwrite((&x[0]) as (&u8), 1, x.len as u64, stdout);
};
main ::= fn() {
puts("Hello, world!\n");
};
>>>>>>> 3fa3c17a12cb52edbcc9890cad59d610e0360f90
|