X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftypes%2Flet_func.h;fp=src%2Ftypes%2Flet_func.h;h=850eb84251889b60553e6775066d448081bc56ab;hb=e5103bb1ce17ef734e1329da9a13d9a2cbc40ad9;hp=526265b9cbf0c9ec44c8e91b59e7f864b1b1d627;hpb=5359ad5c181e5772f350fe1cba060cbed3a05b91;p=m6w6%2Fext-psi diff --git a/src/types/let_func.h b/src/types/let_func.h index 526265b..850eb84 100644 --- a/src/types/let_func.h +++ b/src/types/let_func.h @@ -3,11 +3,18 @@ typedef impl_val *(*let_func_handler)(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); +struct let_val; +struct let_vals; +static inline void free_let_vals(struct let_vals *vals); + typedef struct let_func { token_t type; char *name; impl_var *var; let_func_handler handler; + struct let_vals *inner; + struct let_val *outer; + decl_arg *ref; } let_func; static inline let_func *init_let_func(token_t type, const char *name, impl_var *var) { @@ -21,6 +28,9 @@ static inline let_func *init_let_func(token_t type, const char *name, impl_var * static inline void free_let_func(let_func *func) { free_impl_var(func->var); free(func->name); + if (func->inner) { + free_let_vals(func->inner); + } free(func); }