summaryrefslogtreecommitdiff
path: root/tnslc/vector.tnsl
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2023-08-06 03:00:18 -0400
committerKyle Gunger <kgunger12@gmail.com>2023-08-06 03:00:18 -0400
commitd3dfc56318829e212a87da6874011d8304be31b0 (patch)
tree3e62dd637c5aa64f3ba51c3c08f35e1363efad97 /tnslc/vector.tnsl
parent8535ee80ebccb81cebd61d1f33992aaf682e455a (diff)
Frame out port of compiler
Diffstat (limited to 'tnslc/vector.tnsl')
-rw-r--r--tnslc/vector.tnsl8
1 files changed, 6 insertions, 2 deletions
diff --git a/tnslc/vector.tnsl b/tnslc/vector.tnsl
index d21f83c..87a49e9 100644
--- a/tnslc/vector.tnsl
+++ b/tnslc/vector.tnsl
@@ -10,9 +10,7 @@ struct Vector {
/; resize (uint num_el)
self.dat_size = num_el
- _print_num(~_ptr{0}, ~self.dat)
self.dat = _realloc(self.dat, num_el * self.el_size)
- _print_num(~_ptr{0}, ~self.dat)
;/
/; get (uint i) [~uint8]
@@ -66,6 +64,12 @@ struct Vector {
self.set(i, v.dat + i * self.el_size)
;/
;/
+
+ /; add (Vector v)
+ /; loop (int i = 0; i < v._len()) [i++]
+ self.push(v.get(i))
+ ;/
+ ;/
/; start (int el_size)
self.num_el = 0