summaryrefslogtreecommitdiff
path: root/autodoc.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-08-24 17:32:28 -0600
committerKarl Williamson <khw@cpan.org>2020-09-04 16:13:25 -0600
commit5bf02cafc220d5626eefecb51ee55fc00f7cb8d8 (patch)
treefbbd1bf2ae1b4522864a4f07604bc3c1ac20b08e /autodoc.pl
parent2e90e324a67346d3b67a92bb5098ef8baa0d5666 (diff)
downloadperl-5bf02cafc220d5626eefecb51ee55fc00f7cb8d8.tar.gz
autodoc: Use hash not array for heterogenous elements
Diffstat (limited to 'autodoc.pl')
-rw-r--r--autodoc.pl15
1 files changed, 12 insertions, 3 deletions
diff --git a/autodoc.pl b/autodoc.pl
index 2a09f7be58..f45d140109 100644
--- a/autodoc.pl
+++ b/autodoc.pl
@@ -236,8 +236,11 @@ HDR_DOC:
warn "$0: duplicate API entry for '$element_name' in $where/$section\n";
next;
}
- $docs{$where}{$section}{$element_name}
- = [$flags, $text, $ret_type, $file, @args];
+ $docs{$where}{$section}{$element_name}{flags} = $flags;
+ $docs{$where}{$section}{$element_name}{pod} = $text;
+ $docs{$where}{$section}{$element_name}{file} = $file;
+ $docs{$where}{$section}{$element_name}{ret_type} = $ret_type;
+ push $docs{$where}{$section}{$element_name}{args}->@*, @args;
# Create a special entry with an empty-string name for the
# heading-level documentation.
@@ -258,7 +261,13 @@ HDR_DOC:
sub docout ($$$) { # output the docs for one function
my($fh, $element_name, $docref) = @_;
- my($flags, $pod, $ret_type, $file, @args) = @$docref;
+
+ my $flags = $docref->{flags};
+ my $pod = $docref->{pod};
+ my $ret_type = $docref->{ret_type};
+ my $file = $docref->{file};
+ my @args = $docref->{args}->@*;
+
$element_name =~ s/\s*$//;
warn("Empty pod for $element_name (from $file)") unless $pod =~ /\S/;