X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tools%2Ffmt-luadoc.php;h=b13e38617caf77f2b7c31a75ca67ba958f20d006;hb=66fa0778abcb08026a9f0eabfecbe44ae5dbdd76;hp=938a774ed41179ec719b38b9fd08446f7fa2fcb1;hpb=0d2ccdd39c676cc978af87231e48ae46da17dce9;p=ardour.git diff --git a/tools/fmt-luadoc.php b/tools/fmt-luadoc.php index 938a774ed4..b13e38617c 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); @@ -264,7 +270,17 @@ foreach ($doc as $b) { $classlist[luafn2class ($b['lua'])]['ctor'][] = array ( 'name' => luafn2class ($b['lua']), 'args' => decl2args ($b['ldec']), - 'cand' => canonical_ctor ($b) + 'cand' => canonical_ctor ($b), + 'nil' => false + ); + break; + case "Weak/Shared Pointer NIL Constructor": + checkclass ($b); + $classlist[luafn2class ($b['lua'])]['ctor'][] = array ( + 'name' => luafn2class ($b['lua']), + 'args' => decl2args ($b['ldec']), + 'cand' => canonical_ctor ($b), + 'nil' => true ); break; case "Property": @@ -546,6 +562,7 @@ function traverse_parent ($ns, &$inherited) { asort ($parents); foreach ($parents as $p) { if (!empty ($rv)) { $rv .= ', '; } + if ($p == $ns) { continue; } $rv .= typelink ($p); $inherited[$p] = $classlist[$p]; traverse_parent ($p, $inherited); @@ -577,7 +594,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) { @@ -632,7 +652,13 @@ function format_class_members ($ns, $cl, &$dups) { usort ($cl['ctor'], 'name_sort_cb'); $rv.= '
This documentation is far from complete may be inaccurate and subject to change.