From c517db67a34ba7ba7cab6994bf78a5341b0f7efe Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Mon, 17 Oct 2022 19:53:42 +0200 Subject: [PATCH] :art: clean prim_def --- include/traverse.h | 1 + src/import/import_prim.c | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/traverse.h b/include/traverse.h index 176dc24c..1e9fdb45 100644 --- a/include/traverse.h +++ b/include/traverse.h @@ -49,4 +49,5 @@ ANN m_bool scan2_class_def(const Env, const Class_Def); ANN m_bool check_class_def(const Env, const Class_Def); ANN Type check_exp_call1(const Env env, Exp_Call *const exp); +ANN m_bool scan0_prim_def(const Env env, const Prim_Def pdef); #endif diff --git a/src/import/import_prim.c b/src/import/import_prim.c index 4a984f0a..4afdbd23 100644 --- a/src/import/import_prim.c +++ b/src/import/import_prim.c @@ -12,6 +12,7 @@ #include "gwi.h" #include "array.h" #include "gack.h" +#include "traverse.h" static GACK(gack_prim) { for(m_uint i = 0; i < t->actual_size; i++) { @@ -213,16 +214,10 @@ ANN Type mk_primitive(const Env env, const m_str name, const m_uint size) { return t; } -// actually we should make a Prim_Def -// and either execute and free it already -// or add it to the current ast - -ANN m_bool scan0_prim_def(const Env env, const Prim_Def pdef); - -//ANN Type gwi_primitive(const Gwi gwi, const m_str name, const m_uint size, const ae_flag flag) { ANN m_bool gwi_primitive(const Gwi gwi, const m_str name, const m_uint size, const ae_flag flag) { const Env env = gwi->gwion->env; const Prim_Def pdef = new_prim_def(gwi->gwion->mp, insert_symbol(gwi->gwion->st, name), size, gwi->loc, flag); + if(gwi->gwion->data->cdoc)lint_prim_def(gwi->lint, pdef); if(!env->class_def || !tflag(env->class_def, tflag_tmpl)) { const m_bool ret = scan0_prim_def(gwi->gwion->env, pdef); free_prim_def(gwi->gwion->mp, pdef); -- 2.43.0