more spaces around names between name and 𝕨/𝕩 in error messages

This commit is contained in:
dzaima 2025-03-02 19:55:19 +02:00
parent bdf9a52625
commit 05a9cd736b
3 changed files with 17 additions and 14 deletions

View File

@ -85,9 +85,9 @@ FOR_VARIATION(F)
STATIC_GLOBAL B listVariations_def; STATIC_GLOBAL B listVariations_def;
B listVariations_c2(B t, B w, B x) { 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); usz wia = IA(w);
SGetU(w) SGetU(w)
bool c_incr=false, c_rmFill=false; 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)); u32 c = o2c(GetU(w, i));
if (c=='i') c_incr=true; if (c=='i') c_incr=true;
else if (c=='f') c_rmFill=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); decG(w);
@ -164,13 +164,13 @@ static bool u8_get(u8** cv, u8* cE, const char* x) {
STATIC_GLOBAL B variation_refs; STATIC_GLOBAL B variation_refs;
B variation_c2(B t, B w, B x) { B variation_c2(B t, B w, B x) {
if (!isArr(w)) thrM("𝕨•internal.Variation𝕩: Non-array 𝕨"); if (!isArr(w)) thrM("𝕨 •internal.Variation 𝕩: Non-array 𝕨");
if (!isArr(x)) thrM("𝕨•internal.Variation𝕩: Non-array 𝕩"); if (!isArr(x)) thrM("𝕨 •internal.Variation 𝕩: Non-array 𝕩");
usz xia = IA(x); usz xia = IA(x);
C8Arr* wc = toC8Arr(w); C8Arr* wc = toC8Arr(w);
u8* wp = c8arrv_ptr(wc); u8* wp = c8arrv_ptr(wc);
u8* wpE = wp+PIA(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; B res;
if (*wp == 'A' || *wp == 'S') { if (*wp == 'A' || *wp == 'S') {
bool slice = *wp == 'S'; bool slice = *wp == 'S';
@ -192,7 +192,7 @@ B variation_c2(B t, B w, B x) {
NOGC_E; NOGC_E;
res = taga(r); res = taga(r);
} else thrF("𝕨•internal.Variation𝕩: Bad type \"%R\"", taga(wc)); } else thrF("𝕨 •internal.Variation 𝕩: Bad type \"%R\"", taga(wc));
if (slice) { if (slice) {
Arr* slice = TI(res,slice)(incG(res), 0, IA(res)); 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)); variation_refs = vec_addN(variation_refs, incG(res));
} }
if (wp!=wpE) thrM("𝕨•internal.Variation𝕩: Bad 𝕨"); if (wp!=wpE) thrM("𝕨 •internal.Variation 𝕩: Bad 𝕨");
} else thrM("𝕨•internal.Variation𝕩: Bad start of 𝕨"); } else thrM("𝕨 •internal.Variation 𝕩: Bad start of 𝕨");
decG(x); decG(x);
ptr_dec(wc); ptr_dec(wc);
return res; return res;
@ -257,7 +257,7 @@ static B unshare(B x) {
for (usz i = 0; i < xia; i++) rp[i] = unshare(xp[i]); for (usz i = 0; i < xia; i++) rp[i] = unshare(xp[i]);
return unshareShape(r); 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 iKeep_c1(B t, B x) { return x; }
B iProperties_c2(B t, B w, B 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; i32* rp;
B r = m_i32arrv(&rp, 3); B r = m_i32arrv(&rp, 3);
rp[0] = sizeof(usz)*8; 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) { 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); B r = unshare(x);
decG(x); decG(x);
return r; return r;

View File

@ -1389,7 +1389,7 @@ B nKeys_c1(B t, B x) {
return r.b; return r.b;
} }
B nGet_c2(B t, B w, B x) { 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", "𝕩"); vfyStr(x, "•ns.Get", "𝕩");
x = name_normalize(x); x = name_normalize(x);
B r = ns_getNU(w, x, true); B r = ns_getNU(w, x, true);
@ -1397,7 +1397,7 @@ B nGet_c2(B t, B w, B x) {
return inc(r); return inc(r);
} }
B nHas_c2(B t, B w, B x) { 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", "𝕩"); vfyStr(x, "•ns.Has", "𝕩");
x = name_normalize(x); x = name_normalize(x);
B r = ns_getNU(w, x, false); B r = ns_getNU(w, x, false);

View File

@ -93,6 +93,9 @@ f←•ReBQN{primitives⇐⋈'÷'‿- ⋄ system⇐⟨"primitives", "foo"‿⋈,
!"•ns.Has: 𝕩 must be a string" % {}•ns.Has 12 !"•ns.Has: 𝕩 must be a string" % {}•ns.Has 12
!"•ns.Get: 𝕩 must be a string" % {}•ns.Get "" !"•ns.Get: 𝕩 must be a string" % {}•ns.Get ""
!"•ns.Get: 𝕩 must be a string" % {}•ns.Get 12 !"•ns.Get: 𝕩 must be a string" % {}•ns.Get 12
!"𝕨 •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"}¨ {a1b10} {a'a'b23cde𝕩}"abc" %% "a",1,"b",0123456789,110110,"a",'a',"cde","abc",100100 {m𝕩 {𝕩 m•ns.Get 𝕩}¨ •ns.Keys m {m•ns.Has𝕩}¨ "abcABC"}¨ {a1b10} {a'a'b23cde𝕩}"abc" %% "a",1,"b",0123456789,110110,"a",'a',"cde","abc",100100