aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-01 15:43:24 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-03-01 15:43:24 -0500
commit90548ebb33ea69c6c9e0962d8bab6d3ec72ac90f (patch)
tree575747915cf0fb61019cc238dca72c44c6cf1c22 /compile.c
parente81b7b998a6218f524d5d6c41e98e07d1f5b10b4 (diff)
For debugging purposes, show qualified name (`Foo.baz()`) in function
text
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 8ef7ab03..24c63bd1 100644
--- a/compile.c
+++ b/compile.c
@@ -4213,7 +4213,10 @@ CORD compile_function(env_t *env, ast_t *ast, CORD *staticdefs)
}
}
- CORD text = CORD_all("func ", Match(fndef->name, Var)->name, "(");
+ CORD qualified_name = Match(fndef->name, Var)->name;
+ if (env->namespace && env->namespace->parent && env->namespace->name)
+ qualified_name = CORD_all(env->namespace->name, ".", qualified_name);
+ CORD text = CORD_all("func ", qualified_name, "(");
for (arg_ast_t *arg = fndef->args; arg; arg = arg->next) {
text = CORD_cat(text, type_to_cord(get_arg_ast_type(env, arg)));
if (arg->next) text = CORD_cat(text, ", ");