From 0e24a0beaef55a4753ce4db9d3f5f9a3872bd026 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 6 Jul 2016 16:11:15 +0200 Subject: APIDump: Added explicit IsStatic flag to static functions. --- Server/Plugins/APIDump/main_APIDump.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Server/Plugins/APIDump/main_APIDump.lua') diff --git a/Server/Plugins/APIDump/main_APIDump.lua b/Server/Plugins/APIDump/main_APIDump.lua index 1129a24ec..429a563df 100644 --- a/Server/Plugins/APIDump/main_APIDump.lua +++ b/Server/Plugins/APIDump/main_APIDump.lua @@ -504,8 +504,8 @@ local function ReadDescriptions(a_API, a_Desc) local DoxyFunctions = {}; -- This will contain all the API functions together with their documentation - local function AddFunction(a_Name, a_Params, a_Return, a_Notes) - table.insert(DoxyFunctions, {Name = a_Name, Params = a_Params, Return = a_Return, Notes = a_Notes}); + local function AddFunction(a_Name, a_Params, a_Return, a_IsStatic, a_Notes) + table.insert(DoxyFunctions, {Name = a_Name, Params = a_Params, Return = a_Return, IsStatic = a_IsStatic, Notes = a_Notes}); end if (APIDesc.Functions ~= nil) then @@ -523,11 +523,11 @@ local function ReadDescriptions(a_API, a_Desc) -- Description is available if (FnDesc[1] == nil) then -- Single function definition - AddFunction(func.Name, FnDesc.Params, FnDesc.Return, FnDesc.Notes); + AddFunction(func.Name, FnDesc.Params, FnDesc.Return, FnDesc.IsStatic, FnDesc.Notes); else -- Multiple function overloads for _, desc in ipairs(FnDesc) do - AddFunction(func.Name, desc.Params, desc.Return, desc.Notes); + AddFunction(func.Name, desc.Params, desc.Return, desc.IsStatic, desc.Notes); end -- for k, desc - FnDesc[] end FnDesc.IsExported = true; @@ -778,10 +778,14 @@ local function WriteHtmlClass(a_ClassAPI, a_ClassMenu) end cf:write("\n\n"); for _, func in ipairs(a_Functions) do + local StaticClause = "" + if (func.IsStatic) then + StaticClause = "(STATIC) " + end cf:write("\n"); cf:write("\n"); cf:write("\n"); - cf:write("\n"); + cf:write("\n"); end cf:write("
NameParametersReturn valueNotes
", func.Name, "", LinkifyString(func.Params or "", (a_InheritedName or a_ClassAPI.Name)), "", LinkifyString(func.Return or "", (a_InheritedName or a_ClassAPI.Name)), "", LinkifyString(func.Notes or "(undocumented)", (a_InheritedName or a_ClassAPI.Name)), "
", StaticClause .. LinkifyString(func.Notes or "(undocumented)", (a_InheritedName or a_ClassAPI.Name)), "
\n"); end -- cgit v1.2.3