aboutsummaryrefslogtreecommitdiff
path: root/builtins/types.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-12 23:41:32 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-12 23:41:32 -0400
commitda9cc93c466c65e0294b4b29bec6603b2d4552eb (patch)
treebfd266d559365366802eaf1a285d7983b426f9c8 /builtins/types.c
parent46a2aa2ffc71820767f0cdaead84c26dc240c893 (diff)
Make functions print with `func name(...)->... [file:line]` info
Diffstat (limited to 'builtins/types.c')
-rw-r--r--builtins/types.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtins/types.c b/builtins/types.c
index 512fdfc3..307b4756 100644
--- a/builtins/types.c
+++ b/builtins/types.c
@@ -39,7 +39,11 @@ public Text_t Func$as_text(const void *fn, bool colorize, const TypeInfo *type)
{
(void)fn;
Text_t text = Text$from_str(type->FunctionInfo.type_str);
- if (fn) text = Text$concat(text, Text(": ..."));
+ if (fn) {
+ Text_t *name = get_function_name(*(void**)fn);
+ if (name)
+ text = *name;
+ }
if (fn && colorize)
text = Text$concat(Text("\x1b[32;1m"), text, Text("\x1b[m"));
return text;