From 90548ebb33ea69c6c9e0962d8bab6d3ec72ac90f Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 1 Mar 2025 15:43:24 -0500 Subject: For debugging purposes, show qualified name (`Foo.baz()`) in function text --- compile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compile.c') 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, ", "); -- cgit v1.2.3