aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-06-04 00:50:36 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-06-04 00:50:36 +0330
commita614d8973bf0eed2d12e49398fb34e234a77ccb3 (patch)
tree6e91f546c5ac09a361db197ad4a903732ce72e36 /code
parenta6abc8734563ba8a1920c760dcb3c0147cb458b9 (diff)
fix bug in pointer dereferencing
Diffstat (limited to 'code')
-rw-r--r--code/main.felan23
1 files changed, 21 insertions, 2 deletions
diff --git a/code/main.felan b/code/main.felan
index e6d479f..84e2949 100644
--- a/code/main.felan
+++ b/code/main.felan
@@ -24,11 +24,30 @@ t :: (comptime formatter : string) -> void {
}
};
+sub_string :: (str:string, begin:i64, end:i64) -> string {
+ result := "";
+ result.ptr = str.ptr + begin;
+ result.length = @cast(end-begin,u64);
+ return result;
+};
+
main :: () -> void {
a := '2';
- @insert("a = '3';a = '5';");
- @putc(a);
+ // @insert("a = '3';a = '5';");
+ // @putc(a);
+ println(a);
+ b := &a;
+ println(b.*);
+ println(a);
+ b.* = '5';
+ println(b.*);
+ arr :[10]u8= undefined;
+ arr[0] = '6';
+ @putc(arr[0]);
// t("hello {world}");
+ // str := "abcdef";
+ // print(@cast(9-3,u8));
+ // print(sub_string(str,1,3));
// @insert("print(123);");
};