]> Nishi Git Mirror - gwion.git/commitdiff
:art: Implement '!' as bool
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 24 Sep 2019 19:17:40 +0000 (21:17 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 24 Sep 2019 19:17:40 +0000 (21:17 +0200)
src/lib/func.c
src/lib/object.c
src/lib/prim.c

index 419e2aa8c7dd7517fd558798f756d0ac47fcf65c..80aba0cac26c73d1a902d9abe032097590867077 100644 (file)
@@ -301,7 +301,7 @@ GWION_IMPORT(func) {
   GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "@function", NULL))
   GWI_BB(gwi_oper_add(gwi, opck_func_call))
   GWI_BB(gwi_oper_end(gwi, "=>", NULL))
-  GWI_BB(gwi_oper_ini(gwi, NULL, "@func_ptr", "int"))
+  GWI_BB(gwi_oper_ini(gwi, NULL, "@func_ptr", "bool"))
   GWI_BB(gwi_oper_end(gwi, "!", IntNot))
   GWI_BB(gwi_oper_ini(gwi, "@function", "@func_ptr", NULL))
   GWI_BB(gwi_oper_add(gwi, opck_fptr_at))
index a3c47ddb7774579e7ab47e31a5e6ad650397b91a..ff06d0e1933bb17fc4d44e58cd5d4661c83edfee 100644 (file)
@@ -253,7 +253,7 @@ GWION_IMPORT(object) {
   GWI_BB(gwi_oper_ini(gwi, "Object", "@null", "int"))
   GWI_BB(gwi_oper_end(gwi, "==", EqObject))
   GWI_BB(gwi_oper_end(gwi, "!=", NeqObject))
-  GWI_BB(gwi_oper_ini(gwi, NULL, "Object", "int"))
+  GWI_BB(gwi_oper_ini(gwi, NULL, "Object", "bool"))
   GWI_BB(gwi_oper_add(gwi, opck_unary_meta2))
   GWI_BB(gwi_oper_end(gwi, "!", IntNot))
   gwi_item_ini(gwi, "@null", "null");
index 3f4fc03abe005f248f3a111757361114d81fe246..1992d86a2709df9c0fa1eef4399d7a07ced478af 100644 (file)
@@ -62,7 +62,6 @@ static GWION_IMPORT(int_unary) {
   GWI_BB(gwi_oper_ini(gwi, NULL, "int", "int"))
   GWI_BB(gwi_oper_add(gwi,  opck_unary_meta))
   GWI_BB(gwi_oper_end(gwi,  "-",       int_negate))
-  GWI_BB(gwi_oper_end(gwi,  "!", IntNot))
   CHECK_OP("++", unary, pre_inc)
   CHECK_OP("--", unary, pre_dec)
   GWI_BB(gwi_oper_end(gwi,  "~", int_cmp))
@@ -78,6 +77,8 @@ static GWION_IMPORT(int_values) {
   GWI_BB(gwi_enum_add(gwi, "false", 0))
   GWI_BB(gwi_enum_add(gwi, "true", 1))
   t_bool = gwi_enum_end(gwi);
+  GWI_BB(gwi_oper_ini(gwi, NULL, "int", "bool"))
+  GWI_BB(gwi_oper_end(gwi,  "!", IntNot))
 //  GWI_BB(gwi_item_ini(gwi, "bool", "maybe"))
 //  GWI_BB(gwi_item_end(gwi, 0, NULL))
   gwi_reserve(gwi, "maybe");