feat: implement loops
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user