summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc29
1 files changed, 10 insertions, 19 deletions
diff --git a/test.toc b/test.toc
index b181972..44917ac 100644
--- a/test.toc
+++ b/test.toc
@@ -1,22 +1,13 @@
-#include "std/io.toc";
-
-foo ::= fn() total := 0{
- if "foo" || (1/0) {
- total += 1;
- }
- if !"foo" && (1/0) {
- total += 100;
- }
- if "foo" || "bar" && 0 {
- total += 10;
- }
- if !"foo" || !"bar" {
- total += 1000;
- }
+stdc ::= "msvcrt.dll";
+printf ::= #foreign("printf",stdc) fn (#C &"char const", #C ..) #C int;
+puti ::= fn(i: i32) i32 {
+ fmt := "number: %d\n\0";
+ printf(&fmt[0], i) as i32
}
+// BUG: puti(puti(x))
+sqrtf ::= #foreign("sqrt",stdc) fn(f64) f64;
+
main ::= fn() {
- a := foo();
- b ::= foo();
- puti(a);
- puti(b);
+ f ::= sqrtf(2.0);
}
+main();