summaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-04-26 15:14:45 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-04-26 15:14:45 +0330
commitc85ce38fbb02342d8ef00030d203ab6bcc690f73 (patch)
tree00974fe5bd6611eafa1b44bd226e7b3b75e99c0d /code
parent03796c59c8e0d7140c85eeb23dc3341837fe54b4 (diff)
add @isComptime to determine if code is running in comptime or not
Diffstat (limited to 'code')
-rw-r--r--code/lib/print.felan7
-rw-r--r--code/main.felan7
2 files changed, 11 insertions, 3 deletions
diff --git a/code/lib/print.felan b/code/lib/print.felan
index fd6663c..2680921 100644
--- a/code/lib/print.felan
+++ b/code/lib/print.felan
@@ -1,3 +1,8 @@
+print :: (value:bool)->void{
+ if value print("true");
+ else print("false");
+};
+
print :: (value:u8)->void{
putc value;
};
@@ -164,4 +169,4 @@ print :: (value:u64)->void{
} {}
print_reverse(result, i - 1);
-}; \ No newline at end of file
+};
diff --git a/code/main.felan b/code/main.felan
index 8db7e31..aeb4da9 100644
--- a/code/main.felan
+++ b/code/main.felan
@@ -1,6 +1,9 @@
@import("lib/print.felan");
main :: () -> void {
- str := "123\n";
- print(str);
+ print(@isComptime);
+};
+
+comptime {
+ print(@isComptime);
};