view doc/interpreter/doccheck/mk_undocumented_list @ 12254:23385f2c90b7 release-3-4-x

whitespace fixes
author John W. Eaton <jwe@octave.org>
date Wed, 26 Jan 2011 23:49:42 -0500
parents a34ccc8e2f8e
children 66b2c377b38e
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
bug_report
chdir
comma
debug
exit
F_DUPFD
F_GETFD
F_GETFL
finite
fntests
F_SETFD
F_SETFL
gammaln
home
i
inf
inverse
isbool
isfinite
j
J
lower
lstat
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
shell_cmd
toc
triu
unimplemented
upper
ylabel
ylim
zlabel
zlim