diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-17 17:35:16 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-17 17:35:16 -0500 |
| commit | 1bcf6bdc9a2652366bc152a1d98524743623bdf5 (patch) | |
| tree | 9e5a724b1c4a4167fd8472d93e0e530c6ed04c02 /builtins/array.c | |
| parent | dbd7502a1dcee6b99434f39393cb356efa542ddc (diff) | |
Add cord methods for getting typestrings
Diffstat (limited to 'builtins/array.c')
| -rw-r--r-- | builtins/array.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtins/array.c b/builtins/array.c index d2c5444e..249281ce 100644 --- a/builtins/array.c +++ b/builtins/array.c @@ -271,6 +271,9 @@ public bool Array_equal(const array_t *x, const array_t *y, const TypeInfo *type public CORD Array_cord(const array_t *arr, bool colorize, const TypeInfo *type) { + if (!arr) + return CORD_all("[", generic_cord(NULL, false, type->ArrayInfo.item), "]"); + TypeInfo *item_type = type->ArrayInfo.item; CORD c = "["; for (int64_t i = 0; i < arr->length; i++) { |
