summaryrefslogtreecommitdiff
path: root/autodoc.pl
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2002-09-26 00:40:23 +0100
committerhv <hv@crypt.org>2002-10-02 11:23:38 +0000
commit78c9d76351ef2d0f7047846bbf29e303753d3fda (patch)
tree638c04c6eec66ed5f8c3ab88e2115be921735f2d /autodoc.pl
parent6e1038e0e8c9f648bbb6f25fb061d8c7031520cf (diff)
downloadperl-78c9d76351ef2d0f7047846bbf29e303753d3fda.tar.gz
better handling of whitespace in autodoc declarations; fragment from:
Subject: [PATCH pad.c,h] move all pad-related code to its own src file Message-ID: <20020925234023.A20044@fdgroup.com> p4raw-id: //depot/perl@17952
Diffstat (limited to 'autodoc.pl')
-rw-r--r--autodoc.pl26
1 files changed, 15 insertions, 11 deletions
diff --git a/autodoc.pl b/autodoc.pl
index 33c22232fa..c898c85d9b 100644
--- a/autodoc.pl
+++ b/autodoc.pl
@@ -36,7 +36,7 @@ sub walk_table (&@) {
while (<IN>) {
chomp;
next if /^:/;
- while (s|\\$||) {
+ while (s|\\\s*$||) {
$_ .= <IN>;
chomp;
}
@@ -69,7 +69,7 @@ FUNC:
next FUNC;
}
$line++;
- if ($in =~ /^=for\s+apidoc\s+(.*)\n/) {
+ if ($in =~ /^=for\s+apidoc\s+(.*?)\s*\n/) {
my $proto = $1;
$proto = "||$proto" unless $proto =~ /\|/;
my($flags, $ret, $name, @args) = split /\|/, $proto;
@@ -155,16 +155,20 @@ walk_table { # load documented functions into approriate hash
return "" unless $flags =~ /d/;
$func =~ s/\t//g; $flags =~ s/p//; # clean up fields from embed.pl
$retval =~ s/\t//;
- if ($flags =~ /A/) {
- my $docref = delete $docfuncs{$func};
+ my $docref = delete $docfuncs{$func};
+ if ($docref and @$docref) {
+ if ($flags =~ /A/) {
+ $docref->[0].="x" if $flags =~ /M/;
+ $apidocs{$docref->[4]}{$func} =
+ [$docref->[0] . 'A', $docref->[1], $retval,
+ $docref->[3], @args];
+ } else {
+ $gutsdocs{$docref->[4]}{$func} =
+ [$docref->[0], $docref->[1], $retval, $docref->[3], @args];
+ }
+ }
+ else {
warn "no docs for $func\n" unless $docref and @$docref;
- $docref->[0].="x" if $flags =~ /M/;
- $apidocs{$docref->[4]}{$func} =
- [$docref->[0] . 'A', $docref->[1], $retval, $docref->[3], @args];
- } else {
- my $docref = delete $docfuncs{$func};
- $gutsdocs{$docref->[4]}{$func} =
- [$docref->[0], $docref->[1], $retval, $docref->[3], @args];
}
}
return "";