summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-07-03 18:49:28 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-07-03 18:49:28 -0400
commit8dd389a5f7db1c8ef9e60d900104fef99f25645f (patch)
tree74e07d438e3c30fed3cdb7eec50b37936c4cfc7f /test.toc
parent119950ebde3c9f096d1866ba6448d6bd9b22d063 (diff)
io is working but slow
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc23
1 files changed, 20 insertions, 3 deletions
diff --git a/test.toc b/test.toc
index d79f526..8523940 100644
--- a/test.toc
+++ b/test.toc
@@ -1,5 +1,22 @@
-f();
+#include "std/io.toc", io;
+#include "std/base.toc", base;
-f ::= fn( ) int {
- return 3;
+main ::= fn() {
+ file, err := io.fopen_write("test.txt");
+ if err {
+ base.error("Couldn't open file!");
+ }
+ io.fputs(file, "This file has some stuff in it.");
+ io.puts("Hello!");
+ io.puts("yes");
+ io.fputs(file, "here is more stuff for the file.");
+ for i := 1..1000 {
+ io.fwrites(file, "Here's a line in the file");
+ for j := 1..i {
+ io.fwrites(file, "!");
+ }
+ io.fwrites(file, "\n");
+ }
+ io.fclose(file);
}
+main();