Mercurial > hg > octave-lyh
view doc/interpreter/doccheck/mk_undocumented_list @ 17535:c12c688a35ed default tip lyh
Fix warnings
author | LYH <lyh.kernel@gmail.com> |
---|---|
date | Fri, 27 Sep 2013 17:43:27 +0800 |
parents | 2ced2f59f523 |
children |
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_ unless (@octave_output) { die "Unable to invoke 'run-octave'. Exiting\n" ;} ################################################################################ # 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 bug_report chdir comma debug dbnext exit F_DUPFD F_GETFD F_GETFL fact finite fmod F_SETFD F_SETFL gammaln home i ifelse inf inverse isbool isfinite j J lower lstat nan octave_tmp_file_name 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