Skip to content

Commit 6df2ece

Browse files
committed
FEAT: added /fmt refinement to DUMP function for displaying only internal information about series value without displaying its data
1 parent 362fe7e commit 6df2ece

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

src/boot/natives.r

+1-1
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ do-commands: native [
966966
]
967967

968968
ds: native ["Temporary stack debug"]
969-
dump: native ["Temporary debug dump" v]
969+
dump: native ["Temporary debug dump" v /fmt "only series format"]
970970
check: native ["Temporary series debug check" val [series!]]
971971

972972
do-callback: native [

src/core/d-dump.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
/***********************************************************************
3535
**
36-
*/ void Dump_Series(REBSER *series, const char *memo)
36+
*/ void Dump_Series_Fmt(REBSER *series, const char *memo)
3737
/*
3838
***********************************************************************/
3939
{
@@ -50,6 +50,16 @@
5050
SERIES_REST(series),
5151
SERIES_FLAGS(series)
5252
);
53+
}
54+
55+
/***********************************************************************
56+
**
57+
*/ void Dump_Series(REBSER *series, const char *memo)
58+
/*
59+
***********************************************************************/
60+
{
61+
if (!series) return;
62+
Dump_Series_Fmt(series, memo);
5363
if (SERIES_WIDE(series) == sizeof(REBVAL)) {
5464
Dump_Values(BLK_HEAD(series), SERIES_TAIL(series));
5565
} else

src/core/n-data.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,13 @@ static int Do_Ordinal(REBVAL *ds, REBINT n)
938938
#ifdef _DEBUG
939939
REBVAL *arg = D_ARG(1);
940940

941-
if (ANY_SERIES(arg))
942-
Dump_Series(VAL_SERIES(arg), "=>");
941+
if (ANY_SERIES(arg)) {
942+
if (D_REF(2)) {
943+
Dump_Series_Fmt(VAL_SERIES(arg), "=>");
944+
} else {
945+
Dump_Series(VAL_SERIES(arg), "=>");
946+
}
947+
}
943948
else
944949
Dump_Values(arg, 1);
945950
#endif

0 commit comments

Comments
 (0)