aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/text.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-09-01 13:08:11 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-09-01 13:08:11 -0400
commitc0c6fe863f8e074cbe8297b5da2a476f455b6518 (patch)
tree276bd5a52eec5eb6b2d4980adefb1bf5255951b6 /src/stdlib/text.c
parenta571ccffd795a595e990a3405dcf977aafc33c6c (diff)
Make Texts() macro a bit more flexible.
Diffstat (limited to 'src/stdlib/text.c')
-rw-r--r--src/stdlib/text.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/stdlib/text.c b/src/stdlib/text.c
index ed4023a4..3bff0356 100644
--- a/src/stdlib/text.c
+++ b/src/stdlib/text.c
@@ -1726,10 +1726,9 @@ Int_t Text$memory_size(Text_t text) {
public
Text_t Text$layout(Text_t text) {
switch (text.tag) {
- case TEXT_ASCII: return Texts(Text("ASCII("), Int64$as_text((int64_t[1]){text.length}, false, NULL), Text(")"));
- case TEXT_GRAPHEMES:
- return Texts(Text("Graphemes("), Int64$as_text((int64_t[1]){text.length}, false, NULL), Text(")"));
- case TEXT_BLOB: return Texts(Text("Blob("), Int64$as_text((int64_t[1]){text.length}, false, NULL), Text(")"));
+ case TEXT_ASCII: return Texts(Text("ASCII("), Int64$value_as_text(text.length), Text(")"));
+ case TEXT_GRAPHEMES: return Texts(Text("Graphemes("), Int64$value_as_text(text.length), Text(")"));
+ case TEXT_BLOB: return Texts(Text("Blob("), Int64$value_as_text(text.length), Text(")"));
case TEXT_CONCAT:
return Texts(Text("Concat("), Text$layout(*text.left), Text(", "), Text$layout(*text.right), Text(")"));
default: errx(1, "Invalid text tag: %d", text.tag);