From 03b431700213055fd59431d8212fab7faf9cd58f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Thu, 11 Mar 2021 03:11:34 +0100 Subject: [PATCH] :art: Use libtermcolor :tada: --- src/compile.c | 2 +- src/parse/check.c | 14 +++++++------- tests/driver/Makefile | 2 +- tests/module/Makefile | 2 +- tests/plug/Makefile | 2 +- tests/plug/test.log | 1 + util | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 tests/plug/test.log diff --git a/src/compile.c b/src/compile.c index 6a23ab57..7f1c0fd4 100644 --- a/src/compile.c +++ b/src/compile.c @@ -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) { diff --git a/src/parse/check.c b/src/parse/check.c index 8e40138b..6dd23878 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -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) { diff --git a/tests/driver/Makefile b/tests/driver/Makefile index 93ba7f81..9b397123 100644 --- a/tests/driver/Makefile +++ b/tests/driver/Makefile @@ -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/module/Makefile b/tests/module/Makefile index 93ba7f81..9b397123 100644 --- a/tests/module/Makefile +++ b/tests/module/Makefile @@ -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/Makefile b/tests/plug/Makefile index 521093e6..8e3e8d17 100644 --- a/tests/plug/Makefile +++ b/tests/plug/Makefile @@ -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 index 00000000..87ce6cd6 --- /dev/null +++ b/tests/plug/test.log @@ -0,0 +1 @@ +op_already_imported.gw diff --git a/util b/util index 9da3e2b7..fbddb43e 160000 --- a/util +++ b/util @@ -1 +1 @@ -Subproject commit 9da3e2b76e09c603f1b84217c9c2432618014a88 +Subproject commit fbddb43e8e853cee789e60c13487d53d55ee4498 -- 2.43.0