From 44b41e3058437928a83530c5e6120b87a4865387 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 5 Oct 2016 04:21:09 +0200 Subject: refine Lua doc/doxygen-parser and handle special-cases --- tools/fmt-luadoc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tools/fmt-luadoc.php') diff --git a/tools/fmt-luadoc.php b/tools/fmt-luadoc.php index 938a774ed4..3f7ef99b72 100755 --- a/tools/fmt-luadoc.php +++ b/tools/fmt-luadoc.php @@ -102,6 +102,10 @@ function arg2lua ($argtype, $flags = 0) { return array ($arg => $flags); } + if ($arg == 'luabridge::LuaRef') { + return array ('Lua-Function' => $flags | 4); + } + # check Class declarations first foreach (array_merge ($classes, $consts) as $b) { if ($b['ldec'] == $arg) { @@ -200,6 +204,8 @@ function canonical_decl ($b) { $a = preg_replace ('/([^>]) >/', '$1>', $a); $a = preg_replace ('/^Cairo::/', '', $a); // special case cairo enums $a = preg_replace ('/([^ ])&/', '$1 &', $a); + $a = preg_replace ('/std::vector<([^>]*)> const/', 'const std::vector<$1>', $a); + $a = str_replace ('std::vector', 'vector', $a); $a = str_replace ('vector', 'std::vector', $a); $a = str_replace ('std::string', 'string', $a); $a = str_replace ('string const', 'const string', $a); @@ -577,7 +583,10 @@ function format_args ($args) { foreach ($args as $a) { if (!$first) { $rv .= ', '; }; $first = false; $flags = $a[varname ($a)]; - if ($flags & 2) { + if ($flags & 4) { + $rv .= ''.varname ($a).''; + } + else if ($flags & 2) { $rv .= 'LuaTable {'.typelink (varname ($a), true, 'em').'}'; } elseif ($flags & 1) { -- cgit v1.2.3