summaryrefslogtreecommitdiff
path: root/docgen.lua
diff options
context:
space:
mode:
authorjussi2024-03-29 20:51:43 +0200
committerjussi2024-03-29 20:51:43 +0200
commitb96960a1f97f815a6872fedc422ea950ed477cda (patch)
tree5dd7cc471be60806744b9869358e43cf507202fe /docgen.lua
parent523351609a36ceb48581aa8edab160037a634ea8 (diff)
downloadreilua-enhanced-b96960a1f97f815a6872fedc422ea950ed477cda.tar.gz
reilua-enhanced-b96960a1f97f815a6872fedc422ea950ed477cda.tar.bz2
reilua-enhanced-b96960a1f97f815a6872fedc422ea950ed477cda.zip
Raygui lib examples file browser.
Diffstat (limited to 'docgen.lua')
-rw-r--r--docgen.lua20
1 files changed, 18 insertions, 2 deletions
diff --git a/docgen.lua b/docgen.lua
index b79d19b..6a4f041 100644
--- a/docgen.lua
+++ b/docgen.lua
@@ -33,13 +33,28 @@ local function getParamType( param )
elseif param == "int" then return "integer"
elseif param == "string" then return "string"
elseif param == "bool" then return "boolean"
- elseif param == "bool" then return "boolean"
+ elseif param == "nil" then return "nil"
elseif param:sub( #param - 1, #param ) == "{}" then return "table"
else
return "any"
end
end
+local function getParam( param )
+ local text = ""
+ local params = split( param, "|" )
+
+ for i, p in ipairs( params ) do
+ text = text..getParamType( p )
+
+ if i < #params then
+ text = text.."|"
+ end
+ end
+
+ return text
+end
+
local function parseFunction( line )
local splitted = split( line, "(" )
local parString = splitted[2]:sub(2)
@@ -52,7 +67,8 @@ local function parseFunction( line )
local sepPar = split( par, " " )
parStr = parStr..sepPar[2]
str = str.."---@param "..sepPar[2].." "
- str = str..getParamType( sepPar[1] ).."\n"
+ -- str = str..getParamType( sepPar[1] ).."\n"
+ str = str..getParam( sepPar[1] ).."\n"
if i < #parameters then
parStr = parStr..", "