From 7737b3b889106533df1e71e577fc2637cafd37f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 15 Apr 2022 14:41:48 +0200 Subject: [PATCH] :art: Improve error messages, thanks quibono --- src/parse/check.c | 8 +++----- src/parse/scan2.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/parse/check.c b/src/parse/check.c index e3cdc3b1..4db1f8d1 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -45,7 +45,7 @@ ANN m_bool check_subscripts(Env env, const Array_Sub array, if (is_decl) CHECK_BB(check_implicit(env, e, env->gwion->type[et_int])); while (++depth && (e = e->next)); if (depth != array->depth) - ERR_B(array->exp->pos, _("invalid array acces expression.")) + ERR_B(array->exp->pos, _("invalid array access expression.")) return GW_OK; } @@ -667,9 +667,7 @@ ANN static Func get_template_func(const Env env, Exp_Call *const func, ((Exp_Call *)func)->tmpl = NULL; assert(exp_self(func)); ERR_O(exp_self(func)->pos, - _("function is template. automatic type guess not fully implemented " - "yet.\n" - " please provide template types. eg: ':[type1, type2, ...]'")) + _("function is a template for which automatic type inference is not fully implemented" } ANN static Func predefined_func(const Env env, const Value v, Exp_Call *exp, @@ -728,7 +726,7 @@ ANN static Type_List check_template_args(const Env env, Exp_Call *exp, } } if (args_number < type_number) // TODO: free type_list - ERR_O(exp->func->pos, _("not able to guess types for template call.")) + ERR_O(exp->func->pos, _("not able to infer types for template call.")) return tl; } diff --git a/src/parse/scan2.c b/src/parse/scan2.c index 0b795bc6..b8a9f047 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -135,7 +135,7 @@ ANN static inline m_bool scan2_exp_slice(const Env env, const Exp_Slice *exp) { ANN static m_bool multi_decl(const Env env, const Exp e, const Symbol op) { if (e->exp_type == ae_exp_decl) { if (e->d.exp_decl.list->len > 1) - ERR_B(e->pos, _("cant '%s' from/to a multi-variable declaration."), + ERR_B(e->pos, _("can't '%s' from/to a multi-variable declaration."), s_name(op)) // set_vflag(e->d.exp_decl.list->self->value, vflag_used); } -- 2.43.0