mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
refine Lua doc/doxygen-parser and handle special-cases
This commit is contained in:
parent
f1080c352a
commit
44b41e3058
2 changed files with 11 additions and 1 deletions
|
|
@ -59,6 +59,7 @@ foreach (json_decode (\$json, true) as \$a) {
|
||||||
\$a['decl'] = str_replace ('const long', 'long', \$a['decl']);
|
\$a['decl'] = str_replace ('const long', 'long', \$a['decl']);
|
||||||
\$a['decl'] = str_replace ('const unsigned int', 'unsigned int', \$a['decl']);
|
\$a['decl'] = str_replace ('const unsigned int', 'unsigned int', \$a['decl']);
|
||||||
\$a['decl'] = str_replace ('const unsigned long', 'unsigned long', \$a['decl']);
|
\$a['decl'] = str_replace ('const unsigned long', 'unsigned long', \$a['decl']);
|
||||||
|
\$a['decl'] = str_replace (' ::Vamp::', ' Vamp::', \$a['decl']);
|
||||||
\$canon = str_replace (' *', '*', \$a['decl']);
|
\$canon = str_replace (' *', '*', \$a['decl']);
|
||||||
\$api[\$canon] = \$a;
|
\$api[\$canon] = \$a;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,10 @@ function arg2lua ($argtype, $flags = 0) {
|
||||||
return array ($arg => $flags);
|
return array ($arg => $flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($arg == 'luabridge::LuaRef') {
|
||||||
|
return array ('Lua-Function' => $flags | 4);
|
||||||
|
}
|
||||||
|
|
||||||
# check Class declarations first
|
# check Class declarations first
|
||||||
foreach (array_merge ($classes, $consts) as $b) {
|
foreach (array_merge ($classes, $consts) as $b) {
|
||||||
if ($b['ldec'] == $arg) {
|
if ($b['ldec'] == $arg) {
|
||||||
|
|
@ -200,6 +204,8 @@ function canonical_decl ($b) {
|
||||||
$a = preg_replace ('/([^>]) >/', '$1>', $a);
|
$a = preg_replace ('/([^>]) >/', '$1>', $a);
|
||||||
$a = preg_replace ('/^Cairo::/', '', $a); // special case cairo enums
|
$a = preg_replace ('/^Cairo::/', '', $a); // special case cairo enums
|
||||||
$a = preg_replace ('/([^ ])&/', '$1 &', $a);
|
$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 ('vector', 'std::vector', $a);
|
||||||
$a = str_replace ('std::string', 'string', $a);
|
$a = str_replace ('std::string', 'string', $a);
|
||||||
$a = str_replace ('string const', 'const string', $a);
|
$a = str_replace ('string const', 'const string', $a);
|
||||||
|
|
@ -577,7 +583,10 @@ function format_args ($args) {
|
||||||
foreach ($args as $a) {
|
foreach ($args as $a) {
|
||||||
if (!$first) { $rv .= ', '; }; $first = false;
|
if (!$first) { $rv .= ', '; }; $first = false;
|
||||||
$flags = $a[varname ($a)];
|
$flags = $a[varname ($a)];
|
||||||
if ($flags & 2) {
|
if ($flags & 4) {
|
||||||
|
$rv .= '<span>'.varname ($a).'</span>';
|
||||||
|
}
|
||||||
|
else if ($flags & 2) {
|
||||||
$rv .= '<em>LuaTable</em> {'.typelink (varname ($a), true, 'em').'}';
|
$rv .= '<em>LuaTable</em> {'.typelink (varname ($a), true, 'em').'}';
|
||||||
}
|
}
|
||||||
elseif ($flags & 1) {
|
elseif ($flags & 1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue