aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-06-10 18:03:32 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-06-10 18:03:32 +0330
commitd523a165aee75e038a4ae4985de08443f4037b9c (patch)
tree76fb711ffc6524bd23259b449e34a8414e4fa425 /code
parent71b4af57bdcc91d948d436a459a223c402a6e17d (diff)
fixing some parse order
Diffstat (limited to 'code')
-rw-r--r--code/lib/operator.felan12
-rw-r--r--code/main.felan26
2 files changed, 31 insertions, 7 deletions
diff --git a/code/lib/operator.felan b/code/lib/operator.felan
index 0c72971..998a053 100644
--- a/code/lib/operator.felan
+++ b/code/lib/operator.felan
@@ -833,3 +833,15 @@ __set_item__ :: (left:*[]anytype,index:i64,item:@type_of(left.*.ptr.*)) -> (@typ
__get_item_address__ :: (left:*[]anytype,index:i64) -> (@type_of(left.*.ptr)) {
return (left.*.ptr + index);
};
+
+__get_item__ :: (left:*[]anytype,index:u64) -> (@type_of(left.*.ptr.*)) {
+ return (left.*.ptr + index).*;
+};
+
+__set_item__ :: (left:*[]anytype,index:u64,item:@type_of(left.*.ptr.*)) -> (@type_of(left.*.ptr.*)) {
+ return (left.*.ptr + index).* = item;
+};
+
+__get_item_address__ :: (left:*[]anytype,index:u64) -> (@type_of(left.*.ptr)) {
+ return (left.*.ptr + index);
+};
diff --git a/code/main.felan b/code/main.felan
index 44f620f..9eda0d2 100644
--- a/code/main.felan
+++ b/code/main.felan
@@ -1,13 +1,25 @@
@import("basic.felan");
-main :: () -> void {
- // print_formatted("hello");
- str := string_from("Hey");
-
- append(&str,"\nHello");
+t :: (a:[]u8) -> void {
+ i := 0u64;
+ while i < a.length {
+ print(a[i]);
+ i += 1u64;
+ break;
+ }
+};
- print(slice(str,4,7));
+main :: () -> void {
+ a := (comptime {
+ a:[10]u8 = undefined;
+ i := 0u64;
+ while i < a.length {
+ a[i] = @cast(i,u8);
+ i += 1u64;
+ }
+ a;
+ });
- delete(str);
+ t(a);
};