-- Helper functions {{{
-function errorf(fmt, ...)
- error(string.format(fmt, unpack(arg)), 2)
+function errorf(...)
+ error(string.format(...), 2)
end
function matcherr(s)
error(string.format("Parse error in \"%s...\"", string.sub(s, 1, 50)), 2)
end
-function fprintf(h, fmt, ...)
- h:write(string.format(fmt, unpack(arg)))
+function fprintf(h, ...)
+ h:write(string.format(...))
end
function trim(str)
["o"]="object",
["s"]="string",
["S"]="string",
+ ["a"]="any value",
}
-- }}}
end
param=trim(param)
if string.len(param)>0 then
- for p in string.gfind(param .. ",", "([^,]*),") do
+ for p in string.gmatch(param .. ",", "([^,]*),") do
local spec, objtype, varname=parse_type(p)
idesc=idesc .. spec
table.insert(itypes, objtype)
ids='"' .. info.idesc .. '"'
end
- fprintf(h, " {\"%s\", %s, %s, %s, (ExtlL2CallHandler*)%s, %s, %s},\n",
+ fprintf(h, " {\"%s\", %s, %s, %s, (ExtlL2CallHandler*)%s, %s, %s, FALSE},\n",
info.exported_name, fn, ids, ods, info.chnd,
bool2str4c(info.safe),
bool2str4c(info.untraced))
end
- fprintf(h, " {NULL, NULL, NULL, NULL, NULL, FALSE, FALSE}\n};\n\n")
+ fprintf(h, " {NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, FALSE}\n};\n\n")
end
fn=info.exported_name
end
+ --[[
if info.class~="global" then
fprintf(h, "\\index{%s@%s!", texfriendly(info.class),
texfriendly_typeormod(info.class));
fprintf(h, "%s@\\code{%s}}\n", texfriendly(fn), fn)
end
fprintf(h, "\\index{%s@\\code{%s}}\n", texfriendly(fn), fn)
+ ]]
if info.class~="global" then
fprintf(h, "\\hyperlabel{fn:%s.%s}", info.class, fn)