From 0b6480fe0237ec40f335c7a3a67aead5534861ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 29 Apr 2022 01:01:28 +0200 Subject: [PATCH] :art: capture error msg --- src/lib/lib_func.c | 2 +- src/parse/check.c | 13 ------------- src/vm/vm.c | 3 +-- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/lib/lib_func.c b/src/lib/lib_func.c index f4ffbc0f..5356b213 100644 --- a/src/lib/lib_func.c +++ b/src/lib/lib_func.c @@ -649,7 +649,7 @@ ANN static Type fork_type(const Env env, const Exp_Unary *unary) { ANN Type upvalue_type(const Env env, Capture *cap) { const Value v = nspc_lookup_value1(env->curr, cap->xid); - if(!v)exit(3); + if(!v) ERR_O(cap->pos, _("non existing value")); // did_you_mean if(cap->is_ref && not_upvalue(env, v)) ERR_O(cap->pos, _("can't take ref of a scoped value")); cap->orig = v; diff --git a/src/parse/check.c b/src/parse/check.c index 9c07fb53..d1338583 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -1065,19 +1065,6 @@ ANN static Type check_exp_dot(const Env env, Exp_Dot *member) { return check_dot(env, member); } -/* -// enable static checking -ANN static OP_CHECK(opck_predicate) { - const Exp_Call *call = (Exp_Call*)data; - const Exp predicate = call->args; -const Func f = exp_self(call)->type->info->func; -//f->def->d.code->d.stmt_code.stmt_list->stmt->d.stmt_exp.val; - if(predicate->exp_type != ae_exp_primary || - predicate->d.prim.prim_type != ae_prim_num || - !predicate->d.prim.d.num) exit(12); -} -*/ - ANN m_bool check_type_def(const Env env, const Type_Def tdef) { if (tdef->when) { set_tflag(tdef->type, tflag_contract); diff --git a/src/vm/vm.c b/src/vm/vm.c index 845b7b27..26bd184c 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -1260,8 +1260,7 @@ fflush(stdout); } PRAGMA_POP() } else { -//exit(3); -//return; + static void *_dispatch[] = { &&_regsetimm, &&_regpushimm, &&_regpushfloat, &&_regpushother, &&_regpushaddr, &&_regpushmem, &&_regpushmemfloat, &&_regpushmemother, &&_regpushmemaddr, -- 2.43.0