Mercurial > hg > octave-lyh
view doc/interpreter/doccheck/mk_undocumented_list @ 11387:2750b04a1b5c
Update script to generate undocumented function list.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Fri, 17 Dec 2010 21:51:52 -0800 |
parents | a41acdfa97dc |
children | 0d9640d755b1 |
line wrap: on
line source
#!/usr/bin/perl -w ################################################################################ # Get a list from Octave of all visible functions @octave_output = <<`_END_OCT_SCRIPT_`; ../../run-octave --norc --silent --no-history --eval '\ funclist = vertcat (__list_functions__ , __builtins__) \ disp("#!-separator-!#") \ where = cellfun (\@which, funclist, \"UniformOutput\", 0)' _END_OCT_SCRIPT_ die "Unable to invoke 'run-octave'. Exiting\n" unless (@octave_output); ################################################################################ # Winnow list of functions that require a DOCSTRING $idx = 0; while (($_ = $octave_output[$idx++]) !~ /^#!-separator-!#$/) { push(@all_functions, $1) if (/] = (\w+)$/); } while ($_ = $octave_output[$idx++]) { push(@where, $1) if (/] = (\S*)$/); } # Remove functions based on directory location # deprecated directory, doc/interpreter directory, test/ directory FUNC: foreach $idx (0 .. $#where) { next FUNC if ($where[$idx] =~ /deprecated/i); next FUNC if ($where[$idx] =~ /interpreter/i); next FUNC if ($where[$idx] =~ m#test/#i); push (@functions, $all_functions[$idx]); } # Remove internal functions from the list of features requiring a DOCSTRING @functions = grep (! /^__/, @functions); # Load list of function exceptions not requiring a DOCSTRING # Exception data is stored at the bottom of this script map { chomp, $exceptions{$_}=1; } <DATA>; # Remove exception data from the list @functions = grep (! $exceptions{$_}, @functions); ################################################################################ # Get a list of all documented functions foreach $txi_file (glob("*.txi")) { open(TXI_FILE, $txi_file) or die "Unable to open $txi_file for reading\n"; while (<TXI_FILE>) { $docstrings{$1} = 1 if (/\@DOCSTRING\((\w+)\)/) ; } } ################################################################################ # Find features which have not been documented in the txi files @undocumented = grep (! $docstrings{$_}, @functions); # Exit successfully if no undocumented functions exit(0) if (! @undocumented); $, = "\n"; # Set output record separator print sort(@undocumented); exit(1); ################################################################################ # Exception list of functions not requiring a DOCSTRING ################################################################################ __DATA__ angle bessel besselh besseli besselk bessely chdir comma debug exit F_DUPFD F_GETFD F_GETFL fntests F_SETFD F_SETFL gammaln i inf inverse j J lower nan O_APPEND O_ASYNC O_CREAT O_EXCL O_NONBLOCK O_RDONLY O_RDWR O_SYNC O_TRUNC O_WRONLY paren SEEK_CUR SEEK_END semicolon setenv toc triu unimplemented upper ylabel ylim zlabel zlim