summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-01-06 03:09:02 -0500
committerKyle Gunger <kgunger12@gmail.com>2024-01-06 03:09:02 -0500
commita289dc3762aeedac25d294e23c01b936d1dfd715 (patch)
tree04c7db3c3982eb19e1e05131ac28654631128813
parentac294849eb88801cf839f19ce3fedbd9517d84c2 (diff)
Method loop init
-rw-r--r--compiler.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/compiler.c b/compiler.c
index 7c8db19..4844e05 100644
--- a/compiler.c
+++ b/compiler.c
@@ -673,7 +673,7 @@ char *KEYTYPES = "uint8,uint16,uint32,uint64,uint,int8,int16,int32,int64,int,flo
char *RESERVED = "~`!@#$%^&*()[]{}+-=\"\'\\|:;/?>.<,";
-char *OPS = "~`!%&|^*/+-=.<>";
+char *OPS = "~`!%&|^*/+-=.<>@";
char *MULTI_OPS = "==,&&,||,^^,!==,!&&,!||,!^^,!<,!>,<<,>>,!&,!|,!^,++,--,>==,<==,+=,-=,*=,/=,%=,!=,&=,|=,^=,~=,`=";
char *DELIMS = "()[]{}";
@@ -2336,8 +2336,24 @@ void p2_compile_method(Module *root, CompData *out, Vector *tokens, size_t *pos)
vect_push_string(&sub_name, t->data);
// TODO: method loop
+ Module *mmod = mod_find_sub(root, vect_as_string(&sub_name));
+ vect_end(&sub_name);
- mod_find_sub(root, vect_as_string(&sub_name));
+ for(;*pos < end;*pos = tnsl_next_non_nl(tokens, *pos)) {
+ t = vect_get(tokens, *pos);
+ if(tok_str_eq(t, "/;") != true && tok_str_eq(t, ";;") != true) {
+ continue;
+ }
+
+ p2_compile_function(mmod, out, tokens, pos);
+
+ t = vect_get(tokens, *pos);
+ if(tok_str_eq(t, ";;")) {
+ *pos -= 1;
+ }
+ }
+
+ *pos = end;
}
void p2_file_loop(