diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-01-06 03:09:02 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-01-06 03:09:02 -0500 |
commit | a289dc3762aeedac25d294e23c01b936d1dfd715 (patch) | |
tree | 04c7db3c3982eb19e1e05131ac28654631128813 | |
parent | ac294849eb88801cf839f19ce3fedbd9517d84c2 (diff) |
Method loop init
-rw-r--r-- | compiler.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -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( |