summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc22
1 files changed, 20 insertions, 2 deletions
diff --git a/test.toc b/test.toc
index 44917ac..f9d135c 100644
--- a/test.toc
+++ b/test.toc
@@ -1,3 +1,5 @@
+/*
+
stdc ::= "msvcrt.dll";
printf ::= #foreign("printf",stdc) fn (#C &"char const", #C ..) #C int;
puti ::= fn(i: i32) i32 {
@@ -5,9 +7,25 @@ puti ::= fn(i: i32) i32 {
printf(&fmt[0], i) as i32
}
// BUG: puti(puti(x))
-sqrtf ::= #foreign("sqrt",stdc) fn(f64) f64;
+//sqrt ::= #foreign("sqrt",stdc) fn(f64) f64;
+sqrtf ::= #foreign("sinf",stdc) fn(f32) f32;
+/*
+putf ::= fn(f: f64) i32 {
+ fmt := "number: %f\n\0";
+ printf(&fmt[0], f) as i32
+}
+*/
main ::= fn() {
- f ::= sqrtf(2.0);
+ sqrtf(3.1);
}
main();
+
+*/
+
+foo ::= #foreign("foo","test.dll") fn(f32) f32;
+printf ::= #foreign("printf", "msvcrt.dll") fn(#C &"const char", #C ..) #C int;
+
+main ::= fn() {
+ x ::= foo(2.7);
+}