summaryrefslogtreecommitdiff
path: root/tnslc/utils
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-06-25 00:19:17 -0400
committerKyle Gunger <kgunger12@gmail.com>2024-06-25 00:19:17 -0400
commit3b5de0beed36c10798f96972ec9c9eeb142561c2 (patch)
treed3d02830118992d229717e4657ff87d77ff01c1e /tnslc/utils
parentc4c595fe22bc76aa4d27f2383ec68a0aa74da37c (diff)
Start work on ast gen
Diffstat (limited to 'tnslc/utils')
-rw-r--r--tnslc/utils/iterator.tnsl12
1 files changed, 12 insertions, 0 deletions
diff --git a/tnslc/utils/iterator.tnsl b/tnslc/utils/iterator.tnsl
index b38d71f..c797017 100644
--- a/tnslc/utils/iterator.tnsl
+++ b/tnslc/utils/iterator.tnsl
@@ -19,10 +19,22 @@ struct Iterator {
;/
;/
+ /; at_end [bool]
+ return (self.pos + 1) !< (self.v`.count)
+ ;/
+
/; prev
/; if (self.pos > 0)
self.pos--
;/
;/
+
+ /; get_pos [int]
+ return self.pos
+ ;/
+
+ /; set_pos (int p)
+ self.pos = p
+ ;/
;/