view doc/interpreter/doccheck/mk_undocumented_list @ 14171:2ced2f59f523 stable

doc: miscellaneous documentation improvements * aspell-octave.en.pws: Add new words to spelling dictionary. * expr.txi: Use hyphens in "element-by-element" construction. * install.txi: Miscellaneous docstring improvements. * mk_undocumented_list: Update script. * xlim.m: Add ylim and zlim to function index. * data.cc: Add inf and nan to to function index. * file-io.cc: Add octave_tmp_file_name to function index. Expand docstring for SEEK_CUR and SEEK_END. * help.cc: Miscellaneous docstring improvements. * syscalls.cc: Improve docstrings for F_XXXX series of functions.
author Rik <octave@nomad.inbox5.com>
date Sun, 08 Jan 2012 13:39:44 -0800
parents 5d5685216876
children 9aff1c9fd70f
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