diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-30 22:01:19 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-30 22:01:19 +0330 |
commit | c91d3a8893b9c53c5c8e4c5cff72d7caf44cfee4 (patch) | |
tree | 47eb14dbceea446e9e065a12e08c2feff22d693a /code/lib | |
parent | bb3822cbb347c712925530ded451fc9027f3b26f (diff) |
fixing some minor issues
Diffstat (limited to 'code/lib')
-rw-r--r-- | code/lib/operator.felan | 12 | ||||
-rw-r--r-- | code/lib/types.felan | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/code/lib/operator.felan b/code/lib/operator.felan index d8121c2..2112c57 100644 --- a/code/lib/operator.felan +++ b/code/lib/operator.felan @@ -790,3 +790,15 @@ __shift_right__ :: (left:i64,right:i64) -> i64 { return @shift_right(left,right); }; + +//---------------------- Pointers ------------------------ + +__sum__ :: (left:*anytype,right:i64) -> (@type_of(left)) { + return @add(left,right); +}; + +__sub__ :: (left:*anytype,right:i64) -> (@type_of(left)) { + return @sub(left,right); +}; + + diff --git a/code/lib/types.felan b/code/lib/types.felan index 8c0cbf1..df7f5c3 100644 --- a/code/lib/types.felan +++ b/code/lib/types.felan @@ -2,7 +2,7 @@ string :: []u8; array :: (comptime size:u64, comptime t:type) -> type { return struct { - ptr : t; - size : i32 : size; + ptr : *t; + size : @type_of(size) : size; }; }; |