diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 16:36:40 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 16:36:40 -0400 |
| commit | 6d12f1dce744146dfa9072d574c540e1d49bb31b (patch) | |
| tree | 4ffc721508ba25a6f125147873446365820dd0ff /src/stdlib | |
| parent | 2640c138b305b558bccf1d36f3f0d54fab96e84c (diff) | |
| parent | 52e50e58c6674560056a4dcb787099d739284b02 (diff) | |
Merge branch 'main' into no-colons
Diffstat (limited to 'src/stdlib')
| -rw-r--r-- | src/stdlib/tables.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/stdlib/tables.c b/src/stdlib/tables.c index 71b9c7f4..d59bc113 100644 --- a/src/stdlib/tables.c +++ b/src/stdlib/tables.c @@ -588,13 +588,13 @@ public Text_t Table$as_text(const void *obj, bool colorize, const TypeInfo_t *ty Text("}")); else return Text$concat( - Text("{"), + Text("|"), generic_as_text(NULL, false, table.key), - Text("}")); + Text("|")); } int64_t val_off = (int64_t)value_offset(type); - Text_t text = Text("{"); + Text_t text = table.value == &Void$info ? Text("|") : Text("{"); for (int64_t i = 0, length = Table$length(*t); i < length; i++) { if (i > 0) text = Text$concat(text, Text(", ")); @@ -604,14 +604,11 @@ public Text_t Table$as_text(const void *obj, bool colorize, const TypeInfo_t *ty text = Text$concat(text, Text("="), generic_as_text(entry + val_off, colorize, table.value)); } - if (table.value == &Void$info) - text = Text$concat(text, Text("/")); - if (t->fallback) { text = Text$concat(text, Text("; fallback="), Table$as_text(t->fallback, colorize, type)); } - text = Text$concat(text, Text("}")); + text = Text$concat(text, table.value == &Void$info ? Text("|") : Text("}")); return text; } |
