diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-11-20 11:03:04 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-11-20 13:43:56 +0000 |
commit | 2bdc39bb841662ac16b5855a0d351ffae7e85274 (patch) | |
tree | 4bf3d495b91ce8a2f94f77921eb1ac904546f707 /autodoc.pl | |
parent | 6a235718376473e8a4b38c98dc4a86a0c420afd1 (diff) | |
download | perl-2bdc39bb841662ac16b5855a0d351ffae7e85274.tar.gz |
Merge near-duplicate code for 'api' and 'guts'.
Diffstat (limited to 'autodoc.pl')
-rw-r--r-- | autodoc.pl | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/autodoc.pl b/autodoc.pl index db1572df60..37d40bd27e 100644 --- a/autodoc.pl +++ b/autodoc.pl @@ -58,12 +58,9 @@ DOC: } $docs = "\n$docs" if $docs and $docs !~ /^\n/; if ($flags =~ /m/) { - if ($flags =~ /A/) { - $docs{api}{$curheader}{$name} = [$flags, $docs, $ret, $file, @args]; - } - else { - $docs{guts}{$curheader}{$name} = [$flags, $docs, $ret, $file, @args]; - } + my $where = $flags =~ /A/ ? 'api' : 'guts'; + $docs{$where}{$curheader}{$name} + = [$flags, $docs, $ret, $file, @args]; } else { $docfuncs{$name} = [$flags, $docs, $ret, $file, $curheader, @args]; @@ -190,15 +187,16 @@ while (<IN>) { my $docref = delete $docfuncs{$func}; if ($docref and @$docref) { + my $where; if ($flags =~ /A/) { + $where = 'api'; $docref->[0].="x" if $flags =~ /M/; - $docs{api}{$docref->[4]}{$func} = - [$docref->[0] . 'A', $docref->[1], $retval, $docref->[3], - @args]; + $docref->[0] .= 'A'; } else { - $docs{guts}{$docref->[4]}{$func} = - [$docref->[0], $docref->[1], $retval, $docref->[3], @args]; + $where = 'guts'; } + $docs{$where}{$docref->[4]}{$func} = + [$docref->[0], $docref->[1], $retval, $docref->[3], @args]; } else { warn "no docs for $func\n" unless $seenfuncs{$func}; |