Improve gen_subroutine_pod error message
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/5aae4246 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/5aae4246 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/5aae4246 Branch: refs/heads/master Commit: 5aae42462a907bdab07dadbd1affbe52fabc5c18 Parents: db2ea9a Author: Nick Wellnhofer <[email protected]> Authored: Tue Feb 9 15:13:24 2016 +0100 Committer: Nick Wellnhofer <[email protected]> Committed: Tue Feb 9 15:13:24 2016 +0100 ---------------------------------------------------------------------- compiler/src/CFCPerlPod.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/5aae4246/compiler/src/CFCPerlPod.c ---------------------------------------------------------------------- diff --git a/compiler/src/CFCPerlPod.c b/compiler/src/CFCPerlPod.c index 5cbd312..6a69caf 100644 --- a/compiler/src/CFCPerlPod.c +++ b/compiler/src/CFCPerlPod.c @@ -315,9 +315,11 @@ CFCPerlPod_gen_subroutine_pod(CFCFunction *func, const char *alias, CFCClass *klass, const char *code_sample, const char *class_name, int is_constructor) { + const char *func_name = CFCFunction_get_name(func); + // Only allow "public" subs to be exposed as part of the public API. if (!CFCFunction_public(func)) { - CFCUtil_die("%s#%s is not public", class_name, alias); + CFCUtil_die("%s#%s is not public", class_name, func_name); } char *pod = CFCUtil_sprintf("=head2 %s\n\n", alias); @@ -336,7 +338,6 @@ CFCPerlPod_gen_subroutine_pod(CFCFunction *func, // Get documentation, which may be inherited. CFCDocuComment *docucomment = CFCFunction_get_docucomment(func); if (!docucomment) { - const char *func_name = CFCFunction_get_name(func); CFCClass *parent = klass; while (NULL != (parent = CFCClass_get_parent(parent))) { CFCFunction *parent_func
