summaryrefslogtreecommitdiff
path: root/tnslc/compile
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-03-30 04:15:10 -0400
committerKyle Gunger <kgunger12@gmail.com>2024-03-30 04:15:10 -0400
commitbb7bbcc03386089dce1353e98c071c15c45aa82f (patch)
tree2d0872fb998bddf93e040d3e38051dbef039443d /tnslc/compile
parent59aabd4ed77ff3ede1df368ad134c56a6f8787c0 (diff)
copy file example
Diffstat (limited to 'tnslc/compile')
-rw-r--r--tnslc/compile/generator.tnsl19
1 files changed, 11 insertions, 8 deletions
diff --git a/tnslc/compile/generator.tnsl b/tnslc/compile/generator.tnsl
index 5d71a05..28a834d 100644
--- a/tnslc/compile/generator.tnsl
+++ b/tnslc/compile/generator.tnsl
@@ -1,13 +1,16 @@
/; generate (utils.File fin, fout)
- ~uint8 fa = fin.path.to_cstr('/')
- ~uint8 fb = fout.path.to_cstr('/')
- _printf(fa)
- _printf(newline)
- _printf(fb)
- _printf(newline)
+ fin.open()
+ fout.create()
+
+ uint8 buf = fin.read()
+ /; loop (fin.at_end == false && fout.at_end == false)
+ fout.write(buf)
+ buf = fin.read()
+ ;/
+
+ fin.close()
+ fout.close()
- _delete(fa)
- _delete(fb)
;/