]> Nishi Git Mirror - gwion.git/commitdiff
:art: Improve gack not printing error
authorJérémie Astor <fennecdjay@gmail.com>
Sun, 15 May 2022 16:44:33 +0000 (18:44 +0200)
committerJérémie Astor <fennecdjay@gmail.com>
Sun, 15 May 2022 16:44:33 +0000 (18:44 +0200)
src/parse/scan1.c

index d64c1f66d191826b931443fe78293a5c2b287935..4f5faf19ed8a91c3c192bd1c3e455865ab49f350 100644 (file)
@@ -684,8 +684,12 @@ ANN static m_bool _scan1_func_def(const Env env, const Func_Def fdef) {
   --env->scope->depth;
   env->func = former;
   if (global) env_pop(env, scope);
-  if (fdef->base->xid == insert_symbol("@gack") && !fake.weight)
-    ERR_B(fdef->base->pos, "`@gack` operator not printing anything");
+  if (fdef->base->xid == insert_symbol("@gack") && !fake.weight) {
+    gwerr_basic(_("`@gack` operator does not print anything"), NULL,
+      _("use `<<<` `>>>` in the function"), env->name, fdef->base->pos, 0);
+    env->context->error = true;
+    return GW_ERROR;
+  }
   return ret;
 }