don't rely on bqn_fmt when !FORMATTER or CBQN isn't yet initialized
This commit is contained in:
parent
86ae984af0
commit
46f657713c
@ -100,7 +100,7 @@ B repr_c1(B t, B x) {
|
||||
#if FORMATTER
|
||||
return bqn_repr(x);
|
||||
#else
|
||||
thrM("•Repr: Cannot represent non-numbers without FORMATTER defined");
|
||||
thrM("•Repr: Cannot represent non-numbers with -DFORMATTER=0");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -109,7 +109,7 @@ B fmt_c1(B t, B x) {
|
||||
#if FORMATTER
|
||||
return bqn_fmt(x);
|
||||
#else
|
||||
thrM("•Fmt isn't supported without FORMATTER defined");
|
||||
thrM("•Fmt isn't supported with -DFORMATTER=0");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -822,11 +822,13 @@ void g_pst(void) { vm_pstLive(); fflush(stdout); fflush(stderr); }
|
||||
#else
|
||||
#define ONLY_ALWAYS
|
||||
#endif
|
||||
extern bool cbqn_initialized;
|
||||
static void warn_ln(B x) {
|
||||
if (isArr(x)) fprint_fmt(stderr, "%s items, %S, shape=%H\n", IA(x), eltype_repr(TI(x,elType)), x);
|
||||
else {
|
||||
fprintf(stderr, "atom: ");
|
||||
fprintsB(stderr, x = bqn_fmt(inc(x))); dec(x);
|
||||
if (cbqn_initialized && FORMATTER) { fprintsB(stderr, x = bqn_fmt(inc(x))); dec(x); }
|
||||
else fprintI(stderr, x);
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -789,8 +789,10 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
case 'L': { repl_init(); break; } // just initialize. mostly for perf testing
|
||||
case 'p': { repl_init(); REQARG(p);
|
||||
B r = bqn_fmt(gsc_exec_inline(utf8Decode0(argv[i++]), m_c8vec_0("(-p)"), emptySVec()));
|
||||
printsB(r); dec(r);
|
||||
B r = gsc_exec_inline(utf8Decode0(argv[i++]), m_c8vec_0("(-p)"), emptySVec());
|
||||
if (FORMATTER) { r = bqn_fmt(r); printsB(r); }
|
||||
else { printI(r); }
|
||||
dec(r);
|
||||
printf("\n");
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user