]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix tuples and too many exp to match
authorfennecdjay <astor.jeremie@wanadoo.fr>
Thu, 19 Sep 2019 01:09:46 +0000 (03:09 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Thu, 19 Sep 2019 01:09:46 +0000 (03:09 +0200)
src/lib/tuple.c
src/parse/check.c

index e2a4c6605b82a1da6ed03289f43e703bfd80de40..b3a55d257077f36c1833c817b02c924339145f0a 100644 (file)
@@ -332,7 +332,8 @@ GWION_IMPORT(tuple) {
   GWI_BB(gwi_class_end(gwi))
   SET_FLAG(t_tuple, abstract | ae_flag_template);
   GWI_BB(gwi_oper_ini(gwi, "Object", "Tuple", NULL))
-  GWI_BB(gwi_oper_add(gwi, opck_at_object_tuple))
+  GWI_BB(gwi_oper_add(gwi, opck_at_tuple))
+  GWI_BB(gwi_oper_emi(gwi, opem_at_tuple))
   GWI_BB(gwi_oper_end(gwi, "@=>", ObjectAssign))
   GWI_BB(gwi_oper_add(gwi, opck_cast_tuple))
   GWI_BB(gwi_oper_end(gwi, "$", NULL))
@@ -350,10 +351,6 @@ GWION_IMPORT(tuple) {
   GWI_BB(gwi_oper_add(gwi, opck_at_tuple))
   GWI_BB(gwi_oper_emi(gwi, opem_at_tuple))
   GWI_BB(gwi_oper_end(gwi, "@=>", NULL))
-  GWI_BB(gwi_oper_add(gwi, opck_cast_tuple))
-  GWI_BB(gwi_oper_end(gwi, "$", NULL))
-  GWI_BB(gwi_oper_add(gwi, opck_impl_tuple))
-  GWI_BB(gwi_oper_end(gwi, "@implicit", NULL))
   register_freearg(gwi, TupleUnpack, freearg_tuple_at);
   return GW_OK;
 }
index 2d209fb7b210fc22cc24f98d1a77937c0c61b4d8..9a3b9c212f1467a83562d50a42aec6e97cf77f3e 100644 (file)
@@ -1188,6 +1188,8 @@ ANN static m_bool match_case_exp(const Env env, Exp e) {
       CHECK_OB(op_check(env, &opi))
     }
   }
+  if(e)
+    ERR_B(e->pos, _("too many expression to match"))
   return GW_OK;
 }