From 4cfadd819deb7caad310e64a2b13031ec7b9bcf1 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 4 Oct 2019 13:16:01 +0200 Subject: [PATCH] :art: Reserve id with specialid --- src/lib/engine.c | 1 - src/lib/import.c | 1 + src/lib/object.c | 1 - src/lib/prim.c | 1 - src/lib/shred.c | 1 - src/lib/string.c | 1 - src/lib/vararg.c | 1 - 7 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lib/engine.c b/src/lib/engine.c index 63f8e374..3c97330d 100644 --- a/src/lib/engine.c +++ b/src/lib/engine.c @@ -116,7 +116,6 @@ ANN static m_bool import_core_libs(const Gwi gwi) { GWI_BB(gwi_add_type(gwi, t_now)) struct SpecialId_ spid = { .type=t_now, .exec=RegPushNow, .is_const=1 }; gwi_specialid(gwi, "now", &spid); - gwi_reserve(gwi, "now"); const Type t_complex = gwi_mk_type(gwi, "complex", SZ_COMPLEX , NULL); gwi->gwion->type[et_complex] = t_complex; CHECK_BB(gwi_gack(gwi, t_complex, gack_complex)) diff --git a/src/lib/import.c b/src/lib/import.c index 34570620..8a57673c 100644 --- a/src/lib/import.c +++ b/src/lib/import.c @@ -713,4 +713,5 @@ ANN void gwi_specialid(const Gwi gwi, const m_str id, const SpecialId spid) { a->exec = spid->exec; a->em = spid->em; map_set(&gwi->gwion->data->id, (vtype)insert_symbol(gwi->gwion->st, id), (vtype)a); + gw_reserve(gwi, id); } diff --git a/src/lib/object.c b/src/lib/object.c index 1ab09dfe..ac7995a2 100644 --- a/src/lib/object.c +++ b/src/lib/object.c @@ -264,7 +264,6 @@ GWION_IMPORT(object) { GWI_BB(gwi_oper_end(gwi, "!", IntNot)) gwi_item_ini(gwi, "@null", "null"); gwi_item_end(gwi, 0, NULL); - gwi_reserve(gwi, "this"); struct SpecialId_ spid = { .ck=check_this, .exec=RegPushMem, .is_const=1 }; gwi_specialid(gwi, "this", &spid); return GW_OK; diff --git a/src/lib/prim.c b/src/lib/prim.c index 0e0f42f9..fda939d5 100644 --- a/src/lib/prim.c +++ b/src/lib/prim.c @@ -87,7 +87,6 @@ static GWION_IMPORT(int_values) { GWI_BB(gwi_oper_ini(gwi, NULL, "int", "bool")) GWI_BB(gwi_oper_add(gwi, opck_unary_meta)) // should return bool GWI_BB(gwi_oper_end(gwi, "!", IntNot)) - gwi_reserve(gwi, "maybe"); struct SpecialId_ spid = { .type=t_bool, .exec=RegPushMaybe, .is_const=1 }; gwi_specialid(gwi, "maybe", &spid); return GW_OK; diff --git a/src/lib/shred.c b/src/lib/shred.c index 1b44af03..6c447e27 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -296,7 +296,6 @@ GWION_IMPORT(shred) { GWI_BB(gwi_func_end(gwi, 0)) GWI_BB(gwi_class_end(gwi)) - gwi_reserve(gwi, "me"); struct SpecialId_ spid = { .type=t_shred, .exec=RegPushMe, .is_const=1 }; gwi_specialid(gwi, "me", &spid); diff --git a/src/lib/string.c b/src/lib/string.c index 1591c212..0562c3c9 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -265,7 +265,6 @@ GWION_IMPORT(string) { // gwi_item_end(gwi, ae_flag_const, NULL); // gwi_reserve(gwi, "__func__"); - gwi_reserve(gwi, "__func__"); struct SpecialId_ spid = { .ck=check_funcpp, .exec=RegPushMe, .is_const=1 }; gwi_specialid(gwi, "__func__", &spid); return GW_OK; diff --git a/src/lib/vararg.c b/src/lib/vararg.c index fdc80b14..db9efb4b 100644 --- a/src/lib/vararg.c +++ b/src/lib/vararg.c @@ -117,6 +117,5 @@ GWION_IMPORT(vararg) { register_freearg(gwi, VarargIni, freearg_vararg); struct SpecialId_ spid = { .type=t_vararg, .exec=RegPushImm, .is_const=1 }; gwi_specialid(gwi, "vararg", &spid); - gwi_reserve(gwi, "vararg"); return GW_OK; } -- 2.43.0