From: Jérémie Astor Date: Fri, 13 May 2022 14:37:42 +0000 (+0200) Subject: :art: Improve local error X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=87e4ce72d5777c42ce2430d0af933cbbd7ca7489;p=gwion.git :art: Improve local error --- diff --git a/src/emit/emit.c b/src/emit/emit.c index 737c63b7..312497ef 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -932,7 +932,9 @@ ANN static m_bool emit_prim_locale(const Emitter emit, const Symbol *id) { vm_run(emit->gwion->vm); emit->gwion->vm->bbq->is_running = true; const m_float ret = *(m_float*)shred->reg; - if(ret == -1.0) return GW_ERROR; + if(ret == -1.0) { + ERR_B(prim_pos(id), "error in locale"); + } const Instr instr = emit_add_instr(emit, RegPushImm2); instr->f = ret; return GW_OK; diff --git a/tests/locale/locale_error.gw b/tests/locale/locale_error.gw new file mode 100644 index 00000000..fc98f1ed --- /dev/null +++ b/tests/locale/locale_error.gw @@ -0,0 +1,2 @@ +#! [contains] invalid value for locale +`foo`;