1
0

APIDump: Moved sorting after the renaming.

This commit is contained in:
madmaxoft 2013-09-14 16:20:54 +02:00
parent 694878d2e8
commit d2c2d4ba52
2 changed files with 25 additions and 21 deletions

View File

@ -1315,6 +1315,7 @@ A list of items regarding WebPlugins that have been documented
"%a+\.\.collector", -- AnyClass..collector
"%a+\.new", -- AnyClass.new
"%a+.new_local", -- AnyClass.new_local
"%a+.delete", -- AnyClass.delete
},
} ;

View File

@ -128,26 +128,11 @@ function CreateAPITables()
end
end
local function SortClass(a_ClassAPI)
table.sort(a_ClassAPI.Functions, -- Sort function list
function(f1, f2)
return (f1.Name < f2.Name);
end
);
table.sort(a_ClassAPI.Constants, -- Sort constant list
function(c1, c2)
return (c1.Name < c2.Name);
end
);
end;
local function ParseClass(a_ClassName, a_ClassObj)
local res = {Name = a_ClassName, Functions = {}, Constants = {}, Descendants = {}};
for i, v in pairs(a_ClassObj) do
Add(res, i, v);
end
SortClass(res);
return res;
end
@ -164,12 +149,6 @@ function CreateAPITables()
end
end
end
SortClass(Globals);
table.sort(API,
function(c1, c2)
return (c1.Name < c2.Name);
end
);
return API, Globals;
end
@ -182,6 +161,15 @@ function DumpAPIHtml()
LOG("Dumping all available functions and constants to API subfolder...");
local API, Globals = CreateAPITables();
-- Sort the classes by name:
table.sort(API,
function (c1, c2)
return (string.lower(c1.Name) < string.lower(c2.Name));
end
);
-- Add Globals into the API:
Globals.Name = "Globals";
table.insert(API, Globals);
@ -325,6 +313,20 @@ function ReadDescriptions(a_API)
end
end -- for j, fn
cls.Functions = NewFunctions;
-- Sort the functions (they may have been renamed):
table.sort(cls.Functions,
function(f1, f2)
return (f1.Name < f2.Name);
end
);
-- Sort the constants:
table.sort(cls.Constants,
function(c1, c2)
return (c1.Name < c2.Name);
end
);
end -- for i, cls
-- Sort the descendants lists:
@ -359,6 +361,7 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI)
if (#a_Functions == 0) then
return;
end
if (a_InheritedName ~= nil) then
cf:write("<h2>Functions inherited from " .. a_InheritedName .. "</h2>");
end