docs: always generate arrays instead of iterators in Class
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 11 Aug 2016 15:03:12 +0000 (16:03 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 11 Aug 2016 15:03:12 +0000 (16:03 +0100)
src/scripts/elua/apps/docgen/doctree.lua
src/scripts/elua/apps/docgen/stats.lua
src/scripts/elua/apps/gendoc.lua

index 452bd97..3e0a980 100644 (file)
@@ -147,11 +147,11 @@ M.Class = Node:clone {
     end,
 
     inherits_get = function(self)
-        return self.class:inherits_get()--:to_array()
+        return self.class:inherits_get():to_array()
     end,
 
     functions_get = function(self, ft)
-        return self.class:functions_get(ft)--:to_array()
+        return self.class:functions_get(ft):to_array()
     end,
 
     function_get_by_name = function(self, fn, ft)
@@ -159,7 +159,7 @@ M.Class = Node:clone {
     end,
 
     events_get = function(self)
-        return self.class:events_get()--:to_array()
+        return self.class:events_get():to_array()
     end,
 
     c_get_function_name_get = function(self)
index cec999a..323add2 100644 (file)
@@ -128,7 +128,7 @@ M.check_class = function(cl)
         stat_incr(ct, false)
     end
 
-    for ev in cl:events_get() do
+    for i, ev in ipairs(cl:events_get()) do
         if not ev:documentation_get() then
             print_missing(cl:full_name_get() .. "." .. ev:name_get(), "event")
             stat_incr("event", true)
index 2f6f5da..1a275b7 100644 (file)
@@ -359,7 +359,7 @@ local build_reftable = function(f, title, ctitle, ctype, t, iscl)
 end
 
 local build_functable = function(f, title, ctitle, cl, tp)
-    local t = cl:functions_get(tp):to_array()
+    local t = cl:functions_get(tp)
     if #t == 0 then
         return
     end
@@ -449,7 +449,7 @@ build_inherits = function(cl, t, lvl)
         lbuf:write_b(lbuf:finish())
     end
     t[#t + 1] = { lvl, lbuf:finish() }
-    for cln in cl:inherits_get() do
+    for i, cln in ipairs(cl:inherits_get()) do
         local acl = dtree.Class.by_name_get(cln)
         if not acl then
             error("error retrieving inherited class " .. cln)
@@ -702,7 +702,7 @@ end
 local build_igraph_r
 build_igraph_r = function(cl, nbuf, ibuf)
     local sn = cl:full_name_get():lower():gsub("%.", "_")
-    for cln in cl:inherits_get() do
+    for i, cln in ipairs(cl:inherits_get()) do
         local acl = dtree.Class.by_name_get(cln)
         if not acl then
             error("error retrieving inherited class " .. cln)
@@ -763,7 +763,7 @@ local build_class = function(cl)
         cl, eolian.function_type.PROPERTY)
 
     f:write_h("Events", 3)
-    local evs = cl:events_get():to_array()
+    local evs = cl:events_get()
     if #evs == 0 then
         f:write_raw("This class does not define any events.\n")
     else