diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 15:00:28 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 15:00:28 -0400 |
| commit | 82849ba783e2b8f8e3a040751cd964313470e7f2 (patch) | |
| tree | 89380c5026b4da43d88658a5acf4d2c656ead8fe /builtins/pointer.c | |
| parent | 29a87ff325b5d9682593d66bd17964e5c2447510 (diff) | |
Use Text("...") literal constructor instead of Text$from_str("...")
function call.
Diffstat (limited to 'builtins/pointer.c')
| -rw-r--r-- | builtins/pointer.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/builtins/pointer.c b/builtins/pointer.c index 41f4a2a1..5090edd9 100644 --- a/builtins/pointer.c +++ b/builtins/pointer.c @@ -25,12 +25,12 @@ public Text_t Pointer$as_text(const void *x, bool colorize, const TypeInfo *type Text_t typename = generic_as_text(NULL, false, ptr_info.pointed); Text_t text; if (colorize) - text = Text$concat(Text$from_str("\x1b[34;1m"), Text$from_str(ptr_info.sigil), typename, Text$from_str("\x1b[m")); + text = Text$concat(Text("\x1b[34;1m"), Text$from_str(ptr_info.sigil), typename, Text("\x1b[m")); else text = Text$concat(Text$from_str(ptr_info.sigil), typename); if (ptr_info.is_optional) - text = Text$concat(text, Text$from_str("?")); + text = Text$concat(text, Text("?")); return text; } @@ -38,9 +38,9 @@ public Text_t Pointer$as_text(const void *x, bool colorize, const TypeInfo *type if (!ptr) { Text_t typename = generic_as_text(NULL, false, ptr_info.pointed); if (colorize) - return Text$concat(Text$from_str("\x1b[34;1m!"), typename, Text$from_str("\x1b[m")); + return Text$concat(Text("\x1b[34;1m!"), typename, Text("\x1b[m")); else - return Text$concat(Text$from_str("!"), typename); + return Text$concat(Text("!"), typename); } // Check for recursive references, so if `x.foo = x`, then it prints as @@ -51,13 +51,13 @@ public Text_t Pointer$as_text(const void *x, bool colorize, const TypeInfo *type ++depth; if (r->ptr == ptr) { Text_t text = Text$concat( - Text$from_str(colorize ? "\x1b[34;1m" : ""), + colorize ? Text("\x1b[34;1m") : Text(""), Text$from_str(ptr_info.sigil), - Text$from_str(".."), + Text(".."), Int32$as_text(&depth, false, &$Int32), - Text$from_str(colorize ? "\x1b[m" : "")); + colorize ? Text("\x1b[m") : Text("")); if (ptr_info.is_optional) - text = Text$concat(text, Text$from_str(colorize ? "\x1b[34;1m?\x1b[m" : "?")); + text = Text$concat(text, colorize ? Text("\x1b[34;1m?\x1b[m") : Text("?")); return text; } } @@ -71,12 +71,12 @@ public Text_t Pointer$as_text(const void *x, bool colorize, const TypeInfo *type } Text_t text; if (colorize) - text = Text$concat(Text$from_str("\x1b[34;1m"), Text$from_str(ptr_info.sigil), Text$from_str("\x1b[m"), pointed); + text = Text$concat(Text("\x1b[34;1m"), Text$from_str(ptr_info.sigil), Text("\x1b[m"), pointed); else text = Text$concat(Text$from_str(ptr_info.sigil), pointed); if (ptr_info.is_optional) - text = Text$concat(text, Text$from_str("?")); + text = Text$concat(text, Text("?")); return text; } |
