summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/main.lua
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-09-14 08:38:39 +0200
committermadmaxoft <github@xoft.cz>2013-09-14 08:38:39 +0200
commitbadacdb7c6ccc4200d67b4d0ef4c69f9087422ff (patch)
tree75c4760e057061569e2db86e0f6363c441abda51 /MCServer/Plugins/APIDump/main.lua
parentAPIDump: Added more globally-ignored functions. (diff)
downloadcuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar
cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar.gz
cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar.bz2
cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar.lz
cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar.xz
cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.tar.zst
cuberite-badacdb7c6ccc4200d67b4d0ef4c69f9087422ff.zip
Diffstat (limited to 'MCServer/Plugins/APIDump/main.lua')
-rw-r--r--MCServer/Plugins/APIDump/main.lua26
1 files changed, 21 insertions, 5 deletions
diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua
index 2a4a83be9..446763905 100644
--- a/MCServer/Plugins/APIDump/main.lua
+++ b/MCServer/Plugins/APIDump/main.lua
@@ -247,6 +247,26 @@ function ReadDescriptions(a_API)
local UnexportedDocumented = {}; -- List of API objects that are documented but not exported, simply a list of names
for i, cls in ipairs(a_API) do
+ -- Rename special functions:
+ for j, fn in ipairs(cls.Functions) do
+ if (fn.Name == ".call") then
+ fn.DocID = "constructor";
+ fn.Name = "() <i>(constructor)</i>";
+ elseif (fn.Name == ".add") then
+ fn.DocID = "operator_plus";
+ fn.Name = "<i>operator +</i>";
+ elseif (fn.Name == ".div") then
+ fn.DocID = "operator_div";
+ fn.Name = "<i>operator /</i>";
+ elseif (fn.Name == ".mul") then
+ fn.DocID = "operator_mul";
+ fn.Name = "<i>operator *</i>";
+ elseif (fn.Name == ".sub") then
+ fn.DocID = "operator_sub";
+ fn.Name = "<i>operator -</i>";
+ end
+ end
+
local APIDesc = g_APIDesc.Classes[cls.Name];
if (APIDesc ~= nil) then
cls.Desc = APIDesc.Desc;
@@ -264,11 +284,7 @@ function ReadDescriptions(a_API)
if (APIDesc.Functions ~= nil) then
-- Assign function descriptions:
for j, func in ipairs(cls.Functions) do
- local FnName = func.Name;
- if (FnName == ".call") then
- FnName = "constructor";
- func.Name = "() <i>(constructor)</i>";
- end
+ local FnName = func.DocID or func.Name;
local FnDesc = APIDesc.Functions[FnName];
if (FnDesc ~= nil) then
func.Params = FnDesc.Params;