]> Nishi Git Mirror - gwion.git/commitdiff
:art: Use libtermcolor :tada:
authorJérémie Astor <fennecdjay@gmail.com>
Thu, 11 Mar 2021 02:11:34 +0000 (03:11 +0100)
committerJérémie Astor <fennecdjay@gmail.com>
Thu, 11 Mar 2021 02:11:34 +0000 (03:11 +0100)
src/compile.c
src/parse/check.c
tests/driver/Makefile
tests/module/Makefile
tests/plug/Makefile
tests/plug/test.log [new file with mode: 0644]
util

index 6a23ab577f288e0a6fc27356930f75c9fc515fca..7f1c0fd4ef11df04448f8bcc44f60aa3619da88c 100644 (file)
@@ -138,7 +138,7 @@ ANN static m_uint _compile(struct Gwion_* gwion, struct Compiler* c) {
   if(compiler_open(gwion->mp, c) < 0)
     return 0;
   if(_check(gwion, c) < 0) {
-    gw_err(_("while compiling file '%s'\n"), c->base);
+    gw_err(_("{-}while compiling file `{0}{/}%s{-}`{0}\n"), c->base);
     return 0;
   }
   if(gwion->emit->info->code) {
index 8e40138b6bf62c50842fc5eff8477e227fa18445..6dd23878ea2a0fd7799e888131e703b4f87309e3 100644 (file)
@@ -523,7 +523,7 @@ ANN static m_bool check_func_args(const Env env, Arg_List arg_list) {
 ANN static inline type next_arg_##type(const type e) { \
   const type next = e->next;                           \
   if(next)                                             \
-    gw_err(",");                                       \
+    gw_err(", ");                                      \
   return next;                                         \
 }
 next_arg(Exp)
@@ -531,13 +531,13 @@ next_arg(Arg_List)
 
 ANN static void print_current_args(Exp e) {
   gw_err(_("and not\n  "));
-  do gw_err(" \033[32m%s\033[0m", e->type ? e->type->name : "Unknown");
+  do gw_err(" {G}%s{0}", e->type ? e->type->name : "{-/}Unknown");
   while((e = next_arg_Exp(e)));
   gw_err("\n");
 }
 
 ANN static void print_arg(Arg_List e) {
-  do gw_err(" \033[32m%s\033[0m \033[1m%s\033[0m", e->type ? e->type->name : NULL,
+  do gw_err("{G}%s{0} {/}%s{0}", e->type ? e->type->name : NULL,
        e->var_decl->xid ? s_name(e->var_decl->xid)  : "");
   while((e = next_arg_Arg_List(e)));
 }
@@ -545,21 +545,21 @@ ANN static void print_arg(Arg_List e) {
 ANN2(1) static void function_alternative(const Env env, const Type f, const Exp args, const loc_t pos){
   if(env->context->error) // needed for ufcs
     return;
-  env_err(env, pos, _("argument type(s) do not match for function. should be :"));
+  env_err(env, pos, _("argument type(s) do not match for function."));
   Func up = f->info->func;
   do {
-    gw_err("(%s)  ", up->name);
+    gw_err("{-}(%s){0}  ", up->name);
     const Arg_List e = up->def->base->args;
     if(e)
       print_arg(e);
     else
-      gw_err("\033[32mvoid\033[0m");
+      gw_err("{G}void{0}");
     gw_err("\n");
   } while((up = up->next));
   if(args)
     print_current_args(args);
   else
-    gw_err(_("and not:\n  \033[32mvoid\033[0m\n"));
+    gw_err(_("and not:\n  {G}void{0}\n"));
 }
 
 ANN static m_uint get_type_number(ID_List list) {
index 93ba7f814c05bb8c2a9671ffe1362108d7c77001..9b397123c1285f884f3a958d5be4fd12c5eb4b30 100644 (file)
@@ -1,4 +1,4 @@
-INC      = -I../../include -I../../util/include -I../../ast/include
+INC      = -I../../include -I../../util/include -I../../util/libtermcolor/src -I../../ast/include
 CC       ?= gcc
 
 NAME := ${NAME}
index 93ba7f814c05bb8c2a9671ffe1362108d7c77001..9b397123c1285f884f3a958d5be4fd12c5eb4b30 100644 (file)
@@ -1,4 +1,4 @@
-INC      = -I../../include -I../../util/include -I../../ast/include
+INC      = -I../../include -I../../util/include -I../../util/libtermcolor/src -I../../ast/include
 CC       ?= gcc
 
 NAME := ${NAME}
index 521093e637c79956bdc5072e7a9827e51166f6b9..8e3e8d17a79db66d13b8130f924350a8b83900cf 100644 (file)
@@ -1,4 +1,4 @@
-INC      = -I../../include -I../../util/include -I../../ast/include
+INC      = -I../../include -I../../util/include -I../../util/libtermcolor/src -I../../ast/include
 CC       ?= gcc
 
 NAME := ${NAME}
diff --git a/tests/plug/test.log b/tests/plug/test.log
new file mode 100644 (file)
index 0000000..87ce6cd
--- /dev/null
@@ -0,0 +1 @@
+op_already_imported.gw 
diff --git a/util b/util
index 9da3e2b76e09c603f1b84217c9c2432618014a88..fbddb43e8e853cee789e60c13487d53d55ee4498 160000 (submodule)
--- a/util
+++ b/util
@@ -1 +1 @@
-Subproject commit 9da3e2b76e09c603f1b84217c9c2432618014a88
+Subproject commit fbddb43e8e853cee789e60c13487d53d55ee4498