diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-06-25 00:19:17 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-06-25 00:19:17 -0400 |
commit | 3b5de0beed36c10798f96972ec9c9eeb142561c2 (patch) | |
tree | d3d02830118992d229717e4657ff87d77ff01c1e /tnslc/utils | |
parent | c4c595fe22bc76aa4d27f2383ec68a0aa74da37c (diff) |
Start work on ast gen
Diffstat (limited to 'tnslc/utils')
-rw-r--r-- | tnslc/utils/iterator.tnsl | 12 |
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 + ;/ ;/ |