]> git.decadent.org.uk Git - ion3.git/blobdiff - libextl/libextl-mkexports.in
Add 20081002-1.
[ion3.git] / libextl / libextl-mkexports.in
index bbb672d84ae74961cdf4a8dd4ec11e234c424b86..14674ba892bf6edbadcb6eca4cb503858ca106a2 100644 (file)
 
 -- 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)
@@ -69,6 +69,7 @@ desc2human={
     ["o"]="object",
     ["s"]="string",
     ["S"]="string",
+    ["a"]="any value",
 }
 
 -- }}}
@@ -207,7 +208,7 @@ function parse(d)
         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)
@@ -619,12 +620,14 @@ function write_fndoc(h, fn, info)
         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)