]> Nishi Git Mirror - gwion.git/commitdiff
:art: Reserve id with specialid
authorfennecdjay <astor.jeremie@wanadoo.fr>
Fri, 4 Oct 2019 11:16:01 +0000 (13:16 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Fri, 4 Oct 2019 11:16:01 +0000 (13:16 +0200)
src/lib/engine.c
src/lib/import.c
src/lib/object.c
src/lib/prim.c
src/lib/shred.c
src/lib/string.c
src/lib/vararg.c

index 63f8e37455dcbe8764b5a637e9d1dc7c841f3704..3c97330d1c432f0dc70bfe16597cace2b1f75c25 100644 (file)
@@ -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))
index 345706203ed97a79b505355dfa8e8303eac4e900..8a57673c48544d1b76a0abb47640353089be0522 100644 (file)
@@ -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);
 }
index 1ab09dfe406184cf42221cb5ce1d307abaa7741d..ac7995a2837b11913bcb173777b799f677d89312 100644 (file)
@@ -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;
index 0e0f42f95154de8b98b7a83c44112a419b59a155..fda939d577eb9b1526a4cf582108a2ec8db2a851 100644 (file)
@@ -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;
index 1b44af03850099113f029fd07978400c77f43c37..6c447e27651580d69ad2e9813730a544d1792c71 100644 (file)
@@ -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);
 
index 1591c212d3bc4a804ff01121b2690faeae81fa8d..0562c3c95e7a607d98a8110505e0fd19059e75d6 100644 (file)
@@ -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;
index fdc80b140e8b0b7347953ab871e812c9589b0eae..db9efb4bf08d23257ece27e485a0181e8614133a 100644 (file)
@@ -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;
 }