#define __CLEAN
void ast_cleaner(const Gwion, Ast);
+void class_def_cleaner(const Gwion, Class_Def);
void func_def_cleaner(const Gwion, Func_Def);
#ifdef __CLEAN_IMPL
typedef struct {
clean_ast(a, b->body);
}
+ANN void class_def_cleaner(const Gwion gwion, Class_Def b) {
+ Clean a = { .gwion=gwion };
+ clean_class_def(&a, b);
+ free_class_def(gwion->mp, b);
+}
+
ANN static void clean_enum_def(Clean *a, Enum_Def b) {
clean_id_list(a, b->list);
}
#include "traverse.h"
#include "parse.h"
#include "gwion.h"
+#include "clean.h"
ANN static inline m_bool freeable(const Type a) {
return !GET_FLAG(a, nonnull) && GET_FLAG(a, template);
a->e->def->union_def = NULL;
}
if(a->e->def)
- free_class_def(gwion->mp, a->e->def);
+ class_def_cleaner(gwion, a->e->def);
}
if(a->nspc)
REM_REF(a->nspc, gwion);