feat: implement loops

This commit is contained in:
samsonium
2026-10-22 18:24:28 +03:00
parent 0188991f4d
commit cc5bbd61f2
7 changed files with 396 additions and 4 deletions
+18 -2
View File
@@ -16,7 +16,8 @@ typedef enum
FZL_WALK_CTX_TYPE_GLOBAL,
FZL_WALK_CTX_TYPE_FN,
FZL_WALK_CTX_TYPE_CLASS,
FZL_WALK_CTX_TYPE_ASSIGN
FZL_WALK_CTX_TYPE_ASSIGN,
FZL_WALK_CTX_TYPE_LOOP,
} fzl_walk_ctx_type_t;
// Internal walk function result
@@ -36,8 +37,23 @@ typedef struct fzl_walk_ctx
fzl_walk_ctx_type_t type;
struct fzl_walk_ctx *parent;
fzl_node_t *fn;
size_t initial_env_lvl;
union
{
// function info
struct
{
fzl_node_t *fn;
};
// loops `break`s writeback addrs
struct
{
size_t *breaks;
size_t breaks_count;
size_t breaks_remainder;
};
};
} fzl_walk_ctx_t;
// Walker descriptor