diff options
author | madmaxoft <github@xoft.cz> | 2013-09-29 00:10:42 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-09-29 00:10:42 +0200 |
commit | 1f9397302c6e4381b86a15c3d28e41c9b199473e (patch) | |
tree | cf3cefe966fd6f343e027bfc7b376216518b75ae /MCServer/Plugins/APIDump/main.lua | |
parent | APIDump: Updated cEntity docs. (diff) | |
download | cuberite-1f9397302c6e4381b86a15c3d28e41c9b199473e.tar cuberite-1f9397302c6e4381b86a15c3d28e41c9b199473e.tar.gz cuberite-1f9397302c6e4381b86a15c3d28e41c9b199473e.tar.bz2 cuberite-1f9397302c6e4381b86a15c3d28e41c9b199473e.tar.lz cuberite-1f9397302c6e4381b86a15c3d28e41c9b199473e.tar.xz cuberite-1f9397302c6e4381b86a15c3d28e41c9b199473e.tar.zst cuberite-1f9397302c6e4381b86a15c3d28e41c9b199473e.zip |
Diffstat (limited to '')
-rw-r--r-- | MCServer/Plugins/APIDump/main.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua index 7c200712d..a7b4f7511 100644 --- a/MCServer/Plugins/APIDump/main.lua +++ b/MCServer/Plugins/APIDump/main.lua @@ -291,6 +291,19 @@ end function ReadDescriptions(a_API) + -- Returns true if the class of the specified name is to be ignored + local function IsClassIgnored(a_ClsName) + if (g_APIDesc.IgnoreClasses == nil) then + return false; + end + for i, name in ipairs(g_APIDesc.IgnoreClasses) do + if (a_ClsName:match(name)) then + return true; + end + end + return false; + end + -- Returns true if the function (specified by its fully qualified name) is to be ignored local function IsFunctionIgnored(a_FnName) if (g_APIDesc.IgnoreFunctions == nil) then @@ -317,6 +330,20 @@ function ReadDescriptions(a_API) return false; end + -- Remove ignored classes from a_API: + local APICopy = {}; + for i, cls in ipairs(a_API) do + if not(IsClassIgnored(cls.Name)) then + table.insert(APICopy, cls); + else + LOG("Ignoring class " .. cls.Name); + end + end + for i = 1, #a_API do + a_API[i] = APICopy[i]; + end; + + -- Process the documentation for each class: for i, cls in ipairs(a_API) do -- Rename special functions: for j, fn in ipairs(cls.Functions) do |