aboutsummaryrefslogtreecommitdiff
path: root/code/main.felan
diff options
context:
space:
mode:
Diffstat (limited to 'code/main.felan')
-rw-r--r--code/main.felan30
1 files changed, 27 insertions, 3 deletions
diff --git a/code/main.felan b/code/main.felan
index 0803589..e6d479f 100644
--- a/code/main.felan
+++ b/code/main.felan
@@ -1,10 +1,34 @@
-// @import("basic.felan");
+@import("basic.felan");
+
+t :: (comptime formatter : string) -> void {
+ i := 0;
+ in := 0;
+ opening := 0;
+ while @cast(i,u64) < formatter.length {
+ c := formatter[i];
+ if c == '{' {
+ if in == 0 {
+ opening = i+1;
+ }
+ in += 1;
+ } else if c == '}' {
+ in -= 1;
+ if in == 0{
+ str := sub_string(formatter,opening,i);
+ print(str);
+ } else if in < 0 {
+ in = 0;
+ }
+ }
+ i += 1;
+ }
+};
main :: () -> void {
a := '2';
- @insert("a = '3';");
- @insert("a = '5';");
+ @insert("a = '3';a = '5';");
@putc(a);
+ // t("hello {world}");
// @insert("print(123);");
};