summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-03-26 01:39:31 -0400
committerKyle Gunger <kgunger12@gmail.com>2024-03-26 01:39:31 -0400
commit6c1f5cf72ffd6ed9a3f70395881613fa53e27758 (patch)
tree8aaaeee70f452a45c770b993bc3cd142ce81f499
parent5ff4734f6b8fe64ac64ae55e1afa9d8ff8860ee4 (diff)
Better hello
-rw-r--r--tnslc/tnslc.tnsl16
-rw-r--r--tnslc/vector.tnsl3
2 files changed, 5 insertions, 14 deletions
diff --git a/tnslc/tnslc.tnsl b/tnslc/tnslc.tnsl
index f9b26c7..89fe80b 100644
--- a/tnslc/tnslc.tnsl
+++ b/tnslc/tnslc.tnsl
@@ -7,24 +7,14 @@
:import "compile/compile.tnsl"
+~uint8 HELLO = "hello world\n\0"
+
/; main [int]
utils.Vector vec
vec.init(1)
- vec.push_char('h')
- vec.push_char('e')
- vec.push_char('l')
- vec.push_char('l')
- vec.push_char('o')
- vec.push_char(' ')
- vec.push_char('w')
- vec.push_char('o')
- vec.push_char('r')
- vec.push_char('l')
- vec.push_char('d')
- vec.push_char('\n')
- vec.push_char(0)
+ vec.push_cstr(HELLO)
_printf(vec.data)
diff --git a/tnslc/vector.tnsl b/tnslc/vector.tnsl
index 2175877..c8450ac 100644
--- a/tnslc/vector.tnsl
+++ b/tnslc/vector.tnsl
@@ -57,9 +57,10 @@ uint VECTOR_MAX_GROW = 256
;/
/; push_cstr(~uint8 ch)
- /; loop (ch` != 0) [ch++]
+ /; loop (ch` !== 0) [ch++]
self.push(ch)
;/
+ self.push(ch)
;/
/; end