From: Nicholas Clark Date: Fri, 20 Nov 2009 11:03:04 +0000 (+0000) Subject: Merge near-duplicate code for 'api' and 'guts'. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2bdc39bb841662ac16b5855a0d351ffae7e85274;p=p5sagit%2Fp5-mst-13.2.git Merge near-duplicate code for 'api' and 'guts'. --- diff --git a/autodoc.pl b/autodoc.pl index db1572d..37d40bd 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 () { 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};