Commit 19f2ece7b18d80fd474ba6713a29d9f540fd2e93

Thomas de Grivel 2023-08-12T16:52:22

remove ; in functions

diff --git a/libc3/buf_inspect.c b/libc3/buf_inspect.c
index 1ead071..1a6e950 100644
--- a/libc3/buf_inspect.c
+++ b/libc3/buf_inspect.c
@@ -685,7 +685,7 @@ sw buf_inspect_fn_algo (s_buf *buf, const s_list *algo)
     result += r;
     algo = list_next(algo);
     if (algo) {
-      if ((r = buf_write_1(buf, ";\n  ")) < 0)
+      if ((r = buf_write_1(buf, "\n  ")) < 0)
         return r;
       result += r;
     }
diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index 3fded86..0afae0b 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -1228,14 +1228,6 @@ sw buf_parse_fn_algo (s_buf *buf, s_list **dest)
     if ((r = buf_ignore_spaces(buf)) < 0)
       goto restore;
     result += r;
-    if ((r = buf_read_1(buf, ";")) < 0)
-      goto restore;
-    if (! r)
-      break;
-    result += r;
-    if ((r = buf_ignore_spaces(buf)) < 0)
-      goto restore;
-    result += r;
   }
   if ((r = buf_read_1(buf, "}")) <= 0)
     goto restore;
diff --git a/libc3/env.c b/libc3/env.c
index 8cb4038..2cdbd76 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -526,6 +526,17 @@ bool env_eval_progn (s_env *env, const s_list *program, s_tag *dest)
   return true;
 }
 
+bool env_eval_quote(s_env *env, const s_quote *quote, s_tag *dest)
+{
+  assert(env);
+  assert(quote);
+  assert(dest);
+  (void) env;
+  if (! tag_copy(quote->tag, dest))
+    return false;
+  return true;
+}
+
 bool env_eval_tag (s_env *env, const s_tag *tag, s_tag *dest)
 {
   switch (tag->type) {
@@ -540,6 +551,8 @@ bool env_eval_tag (s_env *env, const s_tag *tag, s_tag *dest)
     return env_eval_call_macro(env, &tag->data.call, dest);
   case TAG_IDENT:
     return env_eval_ident(env, &tag->data.ident, dest);
+  case TAG_QUOTE:
+    return env_eval_quote(env, &tag->data.quote, dest);
   case TAG_ARRAY:
   case TAG_BOOL:
   case TAG_CFN:
@@ -550,7 +563,6 @@ bool env_eval_tag (s_env *env, const s_tag *tag, s_tag *dest)
   case TAG_INTEGER:
   case TAG_LIST:
   case TAG_PTAG:
-  case TAG_QUOTE:
   case TAG_S16:
   case TAG_S32:
   case TAG_S64:
diff --git a/libc3/env.h b/libc3/env.h
index 1babe0e..70d2047 100644
--- a/libc3/env.h
+++ b/libc3/env.h
@@ -47,6 +47,8 @@ bool       env_eval_ident (s_env *env, const s_ident *ident,
                            s_tag *dest);
 bool       env_eval_progn (s_env *env, const s_list *program,
                            s_tag *dest);
+bool       env_eval_quote(s_env *env, const s_quote *quote,
+                          s_tag *dest);
 bool       env_eval_tag (s_env *env, const s_tag *tag, s_tag *dest);
 s_module * env_module_load (s_env *env, s_module *module,
                             const s_sym *name, s_facts *facts);
diff --git a/test/ic3/call.out.expected b/test/ic3/call.out.expected
index 500214c..4dd359e 100644
--- a/test/ic3/call.out.expected
+++ b/test/ic3/call.out.expected
@@ -1,12 +1,12 @@
-quote test()
-quote test(1)
-quote test(1, 2)
-quote test(1, 2, 3)
-quote Test.test()
-quote Test.test(1)
-quote Test.test(1, 2)
-quote Test.test(1, 2, 3)
-quote first((1, 2))
-quote C3.first((1, 2))
+test()
+test(1)
+test(1, 2)
+test(1, 2, 3)
+Test.test()
+Test.test(1)
+Test.test(1, 2)
+Test.test(1, 2, 3)
+first((1, 2))
+C3.first((1, 2))
 1
 2
diff --git a/test/ic3/ident.out.expected b/test/ic3/ident.out.expected
index fd4c50b..d3a5815 100644
--- a/test/ic3/ident.out.expected
+++ b/test/ic3/ident.out.expected
@@ -1,27 +1,27 @@
-quote _" "
-quote _"\n"
-quote _"\0"
-quote _"\n"
-quote _"\r"
-quote _" "
-quote _"\t"
-quote _"\v"
-quote _0
-quote _9
-quote _A
-quote _Z
-quote a
-quote z
-quote _À
-quote _É
-quote _Ÿ
-quote à
-quote é
-quote ÿ
-quote _Π
-quote ꒴
-quote 𐅀
-quote 🎳
-quote 😄
-quote 🟣
-quote 🤩
+_" "
+_"\n"
+_"\0"
+_"\n"
+_"\r"
+_" "
+_"\t"
+_"\v"
+_0
+_9
+_A
+_Z
+a
+z
+_À
+_É
+_Ÿ
+à
+é
+ÿ
+_Π
+꒴
+𐅀
+🎳
+😄
+🟣
+🤩
diff --git a/test/ic3/op.out.expected b/test/ic3/op.out.expected
index 21d9409..3b58e11 100644
--- a/test/ic3/op.out.expected
+++ b/test/ic3/op.out.expected
@@ -1,7 +1,7 @@
-quote 1 + 2
-quote 1 + 2 / 3
-quote 1 + 2 / 3 * 4
-quote 1 + 2 / 3 * 4 - 5
+1 + 2
+1 + 2 / 3
+1 + 2 / 3 * 4
+1 + 2 / 3 * 4 - 5
 3
 1
 1