lang: codegen: implement for-loop code generation

This commit is contained in:
2025-09-08 16:25:39 +01:00
parent 68ca789e43
commit 8425e2db4b
4 changed files with 229 additions and 11 deletions

View File

@@ -48,6 +48,7 @@ enum code_generator_type {
CODE_GENERATOR_COND_GROUP,
CODE_GENERATOR_COND,
CODE_GENERATOR_FOR_LOOP,
CODE_GENERATOR_WHILE_LOOP,
};
enum code_generator_scope_type {
@@ -127,6 +128,8 @@ struct code_generator_state {
const struct code_generator *s_gen;
struct ivy_ast_node *s_root;
size_t s_depth;
struct mie_block *s_loop_break_target, *s_loop_repeat_target;
};
struct ivy_codegen {