q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c98df1c58649e1108c72fe1dbab5b9589ebb95be
commit c98df1c58649e1108c72fe1dbab5b9589ebb95be Author: Daniel Kolesa <[email protected]> Date: Mon Aug 15 14:41:59 2016 +0100 docs: add static getters for wrapped variables --- src/scripts/elua/apps/docgen/doctree.lua | 50 ++++++++++++++++++++++++++++++++ src/scripts/elua/apps/gendoc.lua | 4 +-- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/scripts/elua/apps/docgen/doctree.lua b/src/scripts/elua/apps/docgen/doctree.lua index 128ad75..ff1e330 100644 --- a/src/scripts/elua/apps/docgen/doctree.lua +++ b/src/scripts/elua/apps/docgen/doctree.lua @@ -559,6 +559,56 @@ M.Variable = Node:clone { nspaces_get = function(self, root) return M.Node.nspaces_get(self, self:type_str_get(), root) + end, + + -- static getters + + all_globals_get = function() + local ret = {} + for v in eolian.variable_all_globals_get() do + ret[#ret + 1] = v + end + return ret + end, + + all_constants_get = function() + local ret = {} + for v in eolian.variable_all_constants_get() do + ret[#ret + 1] = v + end + return ret + end, + + globals_by_file_get = function(fn) + local ret = {} + for v in eolian.variable_globals_get_by_file(fn) do + ret[#ret + 1] = v + end + return ret + end, + + constants_by_file_get = function(fn) + local ret = {} + for v in eolian.variable_constants_get_by_file(fn) do + ret[#ret + 1] = v + end + return ret + end, + + global_by_name_get = function(vn) + local v = eolian.variable_global_get_by_name(vn) + if not v then + return nil + end + return M.Variable(v) + end, + + constant_by_name_get = function(vn) + local v = eolian.variable_constant_get_by_name(vn) + if not v then + return nil + end + return M.Variable(v) end } diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua index 29ee38e..5db4243 100644 --- a/src/scripts/elua/apps/gendoc.lua +++ b/src/scripts/elua/apps/gendoc.lua @@ -847,11 +847,11 @@ local build_typedecls = function() end local build_variables = function() - for v in eolian.variable_all_constants_get() do + for i, v in ipairs(dtree.Variable.all_constants_get()) do build_variable(v, true) end - for v in eolian.variable_all_globals_get() do + for i, v in ipairs(dtree.Variable.all_globals_get()) do build_variable(v, false) end end --
