From 8d9d8e84a22535fb6e3f6cde58ba342cc4858472 Mon Sep 17 00:00:00 2001 From: Alexis BRENON Date: Tue, 25 Oct 2016 09:06:01 +0200 Subject: [PATCH 1/2] Add fully_qualified_name and local_name --- ldoc/doc.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index e19b2df..47f799d 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -362,8 +362,10 @@ function File:finish() end end -- Whether to use '.' or the language's version of ':' (e.g. \ for Moonscript) - item.name = class..(not static and this_mod.file.lang.method_call or '.')..item.name - end + item.local_name = item.name + item.fully_qualified_name = class..(not static and this_mod.file.lang.method_call or '.')..item.name + item.name = item.fully_qualified_name + end if stype == 'factory' then if item.tags.private then to_be_removed = true elseif item.type == 'lfunction' then From 94dbff28616ed99dbcaf70da4dfd01c5ed007bb4 Mon Sep 17 00:00:00 2001 From: Alexis BRENON Date: Wed, 26 Oct 2016 09:47:26 +0200 Subject: [PATCH 2/2] More generic approach with a table of names hierarchy --- ldoc/doc.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index 47f799d..97e1ff4 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -362,9 +362,7 @@ function File:finish() end end -- Whether to use '.' or the language's version of ':' (e.g. \ for Moonscript) - item.local_name = item.name - item.fully_qualified_name = class..(not static and this_mod.file.lang.method_call or '.')..item.name - item.name = item.fully_qualified_name + item.name = class..(not static and this_mod.file.lang.method_call or '.')..item.name end if stype == 'factory' then if item.tags.private then to_be_removed = true @@ -411,6 +409,10 @@ function File:finish() -- must be a free-standing function (sometimes a problem...) end end + item.names_hierarchy = require('pl.utils').split( + item.name, + '[.:]' + ) end end @@ -1357,4 +1359,3 @@ function doc.filter_objects_through_function(filter, module_list) end return doc -