From 05a9cd736bd34cf43d9db8355a6abeffd54f60c3 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sun, 2 Mar 2025 19:55:19 +0200 Subject: [PATCH] =?UTF-8?q?more=20spaces=20around=20names=20between=20name?= =?UTF-8?q?=20and=20=F0=9D=95=A8/=F0=9D=95=A9=20in=20error=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/internal.c | 24 ++++++++++++------------ src/builtins/sysfn.c | 4 ++-- test/cases/system.bqn | 3 +++ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/builtins/internal.c b/src/builtins/internal.c index dee8129e..855d1f87 100644 --- a/src/builtins/internal.c +++ b/src/builtins/internal.c @@ -85,9 +85,9 @@ FOR_VARIATION(F) STATIC_GLOBAL B listVariations_def; B listVariations_c2(B t, B w, B x) { - if (!isArr(x)) thrM("𝕨•internal.ListVariations𝕩: 𝕩 must be an array"); + if (!isArr(x)) thrM("𝕨 •internal.ListVariations 𝕩: 𝕩 must be an array"); - if (!isArr(w) || RNK(w)!=1) thrM("𝕨•internal.ListVariations𝕩: 𝕨 must be a list"); + if (!isArr(w) || RNK(w)!=1) thrM("𝕨 •internal.ListVariations 𝕩: 𝕨 must be a list"); usz wia = IA(w); SGetU(w) bool c_incr=false, c_rmFill=false; @@ -95,7 +95,7 @@ B listVariations_c2(B t, B w, B x) { u32 c = o2c(GetU(w, i)); if (c=='i') c_incr=true; else if (c=='f') c_rmFill=true; - else thrF("𝕨internal.ListVariations𝕩: Unknown option '%c' in 𝕨", c); + else thrF("𝕨 internal.ListVariations 𝕩: Unknown option '%c' in 𝕨", c); } decG(w); @@ -164,13 +164,13 @@ static bool u8_get(u8** cv, u8* cE, const char* x) { STATIC_GLOBAL B variation_refs; B variation_c2(B t, B w, B x) { - if (!isArr(w)) thrM("𝕨•internal.Variation𝕩: Non-array 𝕨"); - if (!isArr(x)) thrM("𝕨•internal.Variation𝕩: Non-array 𝕩"); + if (!isArr(w)) thrM("𝕨 •internal.Variation 𝕩: Non-array 𝕨"); + if (!isArr(x)) thrM("𝕨 •internal.Variation 𝕩: Non-array 𝕩"); usz xia = IA(x); C8Arr* wc = toC8Arr(w); u8* wp = c8arrv_ptr(wc); u8* wpE = wp+PIA(wc); - if (PIA(wc)==0) thrM("𝕨•internal.Variation𝕩: Zero-length 𝕨"); + if (PIA(wc)==0) thrM("𝕨 •internal.Variation 𝕩: Zero-length 𝕨"); B res; if (*wp == 'A' || *wp == 'S') { bool slice = *wp == 'S'; @@ -192,7 +192,7 @@ B variation_c2(B t, B w, B x) { NOGC_E; res = taga(r); - } else thrF("𝕨•internal.Variation𝕩: Bad type \"%R\"", taga(wc)); + } else thrF("𝕨 •internal.Variation 𝕩: Bad type \"%R\"", taga(wc)); if (slice) { Arr* slice = TI(res,slice)(incG(res), 0, IA(res)); @@ -207,8 +207,8 @@ B variation_c2(B t, B w, B x) { } variation_refs = vec_addN(variation_refs, incG(res)); } - if (wp!=wpE) thrM("𝕨•internal.Variation𝕩: Bad 𝕨"); - } else thrM("𝕨•internal.Variation𝕩: Bad start of 𝕨"); + if (wp!=wpE) thrM("𝕨 •internal.Variation 𝕩: Bad 𝕨"); + } else thrM("𝕨 •internal.Variation 𝕩: Bad start of 𝕨"); decG(x); ptr_dec(wc); return res; @@ -257,7 +257,7 @@ static B unshare(B x) { for (usz i = 0; i < xia; i++) rp[i] = unshare(xp[i]); return unshareShape(r); } - default: thrF("𝕨•internal.Unshare𝕩: Cannot unshare array with type %i=%S", TY(x), type_repr(TY(x))); + default: thrF("•internal.Unshare 𝕩: Cannot unshare array with type %i=%S", TY(x), type_repr(TY(x))); } } @@ -384,7 +384,7 @@ B iPureKeep_c1(B t, B x) { return x; } B iKeep_c1(B t, B x) { return x; } B iProperties_c2(B t, B w, B x) { - if (w.u!=m_c32(0).u || x.u != m_c32(0).u) thrM("𝕨•internal.Properties𝕩: bad arg"); + if (w.u!=m_c32(0).u || x.u != m_c32(0).u) thrM("𝕨 •internal.Properties 𝕩: bad arg"); i32* rp; B r = m_i32arrv(&rp, 3); rp[0] = sizeof(usz)*8; @@ -394,7 +394,7 @@ B iProperties_c2(B t, B w, B x) { } B unshare_c1(B t, B x) { - if (!isArr(x)) thrM("•internal.Unshare𝕩: 𝕩 must be an array"); + if (!isArr(x)) thrM("•internal.Unshare 𝕩: 𝕩 must be an array"); B r = unshare(x); decG(x); return r; diff --git a/src/builtins/sysfn.c b/src/builtins/sysfn.c index 6bbcfc3f..972e0339 100644 --- a/src/builtins/sysfn.c +++ b/src/builtins/sysfn.c @@ -1389,7 +1389,7 @@ B nKeys_c1(B t, B x) { return r.b; } B nGet_c2(B t, B w, B x) { - if (!isNsp(w)) thrM("𝕨•ns.Get 𝕩: 𝕨 must be a namespace"); + if (!isNsp(w)) thrM("𝕨 •ns.Get 𝕩: 𝕨 must be a namespace"); vfyStr(x, "•ns.Get", "𝕩"); x = name_normalize(x); B r = ns_getNU(w, x, true); @@ -1397,7 +1397,7 @@ B nGet_c2(B t, B w, B x) { return inc(r); } B nHas_c2(B t, B w, B x) { - if (!isNsp(w)) thrM("𝕨•ns.Has 𝕩: 𝕨 must be a namespace"); + if (!isNsp(w)) thrM("𝕨 •ns.Has 𝕩: 𝕨 must be a namespace"); vfyStr(x, "•ns.Has", "𝕩"); x = name_normalize(x); B r = ns_getNU(w, x, false); diff --git a/test/cases/system.bqn b/test/cases/system.bqn index f16a4f18..842dcf3d 100644 --- a/test/cases/system.bqn +++ b/test/cases/system.bqn @@ -93,6 +93,9 @@ f←•ReBQN{primitives⇐⋈'÷'‿- ⋄ system⇐⟨"primitives", "foo"‿⋈, !"•ns.Has: 𝕩 must be a string" % {⇐}•ns.Has 1‿2 !"•ns.Get: 𝕩 must be a string" % {⇐}•ns.Get ≍"" !"•ns.Get: 𝕩 must be a string" % {⇐}•ns.Get 1‿2 +!"𝕨 •ns.Get 𝕩: 𝕨 must be a namespace" % 1•ns.Get "hi" +!"𝕨 •ns.Has 𝕩: 𝕨 must be a namespace" % 1•ns.Has "hi" +!"•ns.Keys 𝕩: 𝕩 must be a namespace" % •ns.Keys 1 {m←𝕩 ⋄ ⟨{𝕩 ⋈ m•ns.Get 𝕩}¨ •ns.Keys m ⋄ {m•ns.Has⋈𝕩}¨ "abcABC"⟩}¨ ⟨{a⇐1⋄b⇐↕10} ⋄ {a⇐'a'⋄b←2‿3⋄cde⇐𝕩}"abc"⟩ %% ⟨⟨⟨⟨"a",1⟩,⟨"b",0‿1‿2‿3‿4‿5‿6‿7‿8‿9⟩⟩,1‿1‿0‿1‿1‿0⟩,⟨⟨⟨"a",'a'⟩,⟨"cde","abc"⟩⟩,1‿0‿0‿1‿0‿0⟩⟩