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/string.c | |
| parent | dbd7502a1dcee6b99434f39393cb356efa542ddc (diff) | |
Add cord methods for getting typestrings
Diffstat (limited to 'builtins/string.c')
| -rw-r--r-- | builtins/string.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/builtins/string.c b/builtins/string.c index 31998d66..4cfa00ee 100644 --- a/builtins/string.c +++ b/builtins/string.c @@ -21,6 +21,13 @@ extern const void *SSS_HASH_VECTOR; +public CORD Str__cord(const void *str, bool colorize, const TypeInfo *info) +{ + (void)info; + if (!str) return "Str"; + return Str__quoted(*(CORD*)str, colorize); +} + public CORD Str__quoted(CORD str, bool colorize) { // Note: it's important to have unicode strings not get broken up with @@ -256,7 +263,7 @@ public Str_namespace_t Str_type = { .align=alignof(CORD), .tag=CustomInfo, .CustomInfo={ - .cord=(void*)Str__quoted, + .cord=(void*)Str__cord, .compare=(void*)Str__compare, .equal=(void*)Str__equal, .hash=(void*)Str__hash, |
