From 95f293e67e5116fea5066928f1b0813c8c5e24c9 Mon Sep 17 00:00:00 2001 From: steve donovan Date: Tue, 5 Mar 2013 17:56:30 +0200 Subject: [PATCH] ordinary non 'method' functions of a 'class' must be respected, and not prefixed with class: --- ldoc/doc.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index 9f3eb0d..efa8a2e 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -296,12 +296,13 @@ function File:finish() if this_mod.section then local this_section = this_mod.section item.section = this_section.display_name - -- if it was a class, then the name should be 'Class:foo' + -- if it was a class, then if the name is unqualified then it becomes + -- 'Class:foo' (unless explicitly flagged as being a constructor) local stype = this_section.type if doc.class_tag(stype) then - local prefix = this_section.name .. (not item.tags.constructor and ':' or '.') - if not has_prefix(item.name,prefix) then - item.name = prefix .. item.name + if not item.name:match '[:%.]' then -- not qualified + local class = this_section.name + item.name = class..(not item.tags.constructor and ':' or '.')..item.name end if stype == 'factory' then if item.tags.private then to_be_removed = true