aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/lists.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-23 15:28:53 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-23 15:28:53 -0500
commit4771d6394d84eefaa45b661c1af8e20ac092a225 (patch)
tree6c0f08c7a6386eb454ef5b3a9059b84883a9ecdb /src/stdlib/lists.h
parent0ea6cdf216ca765039f3c01f5b32dc1103265b58 (diff)
parent1a62de25c448d2661864ba25a98686ed506e66af (diff)
Merge branch 'dev'
Diffstat (limited to 'src/stdlib/lists.h')
-rw-r--r--src/stdlib/lists.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/stdlib/lists.h b/src/stdlib/lists.h
index 6a0a1d43..9ac8bf1b 100644
--- a/src/stdlib/lists.h
+++ b/src/stdlib/lists.h
@@ -20,8 +20,9 @@ extern char _EMPTY_LIST_SENTINEL;
int64_t index = index_expr; \
int64_t off = index + (index < 0) * (list.length + 1) - 1; \
if (unlikely(off < 0 || off >= list.length)) \
- fail_source(__SOURCE_FILE__, start, end, "Invalid list index: ", index, " (list has length ", \
- (int64_t)list.length, ")\n"); \
+ fail_source(__SOURCE_FILE__, start, end, \
+ Text$concat(Text("Invalid list index: "), convert_to_text(index), Text(" (list has length "), \
+ convert_to_text((int64_t)list.length), Text(")\n"))); \
*(item_type *)(list.data + list.stride * off); \
})
#define List_get(list_expr, index_expr, item_type, var, optional_expr, none_expr) \
@@ -40,8 +41,9 @@ extern char _EMPTY_LIST_SENTINEL;
int64_t index = index_expr; \
int64_t off = index + (index < 0) * (list->length + 1) - 1; \
if (unlikely(off < 0 || off >= list->length)) \
- fail_source(__SOURCE_FILE__, start, end, "Invalid list index: ", index, " (list has length ", \
- (int64_t)list->length, ")\n"); \
+ fail_source(__SOURCE_FILE__, start, end, \
+ Text$concat(Text("Invalid list index: "), convert_to_text(index), Text(" (list has length "), \
+ convert_to_text((int64_t)list->length), Text(")\n"))); \
if (list->data_refcount > 0) List$compact(list, sizeof(item_type)); \
(item_type *)(list->data + list->stride * off); \
})