Commit e1ab1d84ce0442a133e1b9a2d33b675df7e0a43d

Thomas de Grivel 2024-03-26T10:36:57

better error message for unbound equal on both sides

diff --git a/.ic3_history b/.ic3_history
index d29979a..e5bc7b3 100644
--- a/.ic3_history
+++ b/.ic3_history
@@ -1,4 +1,3 @@
-  1 + 1
   2 + 2
 end
 def
@@ -97,3 +96,4 @@ double(beaucoup)
 dt
 double(3/4)
 1 / double(3/4)
+a = b
diff --git a/libc3/env.c b/libc3/env.c
index ce07565..cac5305 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -470,9 +470,14 @@ bool env_eval_equal_tag (s_env *env, bool macro, const s_tag *a,
   is_unbound_b = ! macro && b->type == TAG_IDENT;
   if (is_unbound_a && is_unbound_b) {
     err_write_1("env_eval_equal_tag: unbound equal on both sides: ");
-    err_inspect_ident(&a->data.ident),
+    err_inspect_ident(&a->data.ident);
     err_write_1(" = ");
     err_inspect_ident(&b->data.ident);
+    err_write_1(".\nTo assign a variable an existing variable, use"
+                " the pin operator on the\nexisting variable: ");
+    err_inspect_ident(&a->data.ident);
+    err_write_1(" = ^ ");
+    err_inspect_ident(&b->data.ident);
     err_write_1("\n");
     return false;
   }