summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2023-08-17 21:14:34 -0400
committerKyle Gunger <kgunger12@gmail.com>2023-08-17 21:14:34 -0400
commit02e3121d70b8e3d3d2fa333dc0fef9cc63b5f93a (patch)
tree00b96e206a4daa1c5c6b7f52d5057d96ddde8a5c
parenta0108fa817c7258ab97c3c2749897c44e5467d1d (diff)
Change how CompData writes to a file
-rw-r--r--tnslc/compiler.tnsl18
1 files changed, 10 insertions, 8 deletions
diff --git a/tnslc/compiler.tnsl b/tnslc/compiler.tnsl
index 51ed4d6..bac32ae 100644
--- a/tnslc/compiler.tnsl
+++ b/tnslc/compiler.tnsl
@@ -32,15 +32,17 @@ struct CompData {
;/
/; write_file(~void fd)
- uint8 z = 0
-
- self.hsec.push(~z)
- self.dsec.push(~z)
- self.csec.push(~z)
+ /; loop (int i = 0; i < self.hsec.num_el) [i++]
+ _write_byte(fd, self.hsec.get(i))
+ ;/
+
+ /; loop (int i = 0; i < self.dsec.num_el) [i++]
+ _write_byte(fd, self.dsec.get(i))
+ ;/
- write_to_file(fd, self.hsec.dat)
- write_to_file(fd, self.dsec.dat)
- write_to_file(fd, self.csec.dat)
+ /; loop (int i = 0; i < self.csec.num_el) [i++]
+ _write_byte(fd, self.csec.get(i))
+ ;/
;/
;/