From 89a27e4159b2b01be96b5f8ca51832766e878c51 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Mon, 25 Mar 2024 22:16:48 -0400 Subject: len fix for variables --- tnslc/iterator.tnsl | 39 --------------------------------------- tnslc/main.tnsl | 8 +++++++- 2 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 tnslc/iterator.tnsl (limited to 'tnslc') diff --git a/tnslc/iterator.tnsl b/tnslc/iterator.tnsl deleted file mode 100644 index 19dda8c..0000000 --- a/tnslc/iterator.tnsl +++ /dev/null @@ -1,39 +0,0 @@ -struct Iterator { - ~void data, - int size, - current, - _elsz -} - -/; method Iterator - - /; init (~void data, int count, int elsz) - self.data = data - self.size = size - self._elsz = elsz - self.current = 0 - ;/ - - /; next (int count) - self.current = self.current + count - /; if (self.current >= self.size) - self.current = self.size - ;/ - ;/ - - /; prev (int count) - self.current = self.current - count - /; if (self.current < 0) - self.current = 0 - ;/ - ;/ - - /; get [~void] - return self.data + current * _elsz - ;/ - - /; end [bool] - return self.current >= self.size - ;/ - -;/ diff --git a/tnslc/main.tnsl b/tnslc/main.tnsl index cf2e8ac..db68650 100644 --- a/tnslc/main.tnsl +++ b/tnslc/main.tnsl @@ -5,7 +5,13 @@ a.push(~c) ;/ -/; main [int] +/; main (int argc, ~~uint8 argv) [int] + + asm "mov r10, rdi" + asm "mov r11, rsi" + + _print_num(PUSH_STR, argc) + Vector a a.init(1) -- cgit v1.2.3