summaryrefslogtreecommitdiff
path: root/autodoc.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-05-29 16:01:34 -0600
committerKarl Williamson <khw@cpan.org>2019-05-30 18:13:29 -0600
commit0a60f600e691409aab41f710bbbd8801a3162143 (patch)
treef96b3d02392dee02bb3f9c34cfdee900c9f6bdc7 /autodoc.pl
parent1fcde0e9beb6235547b567747353bc1b85262783 (diff)
downloadperl-0a60f600e691409aab41f710bbbd8801a3162143.tar.gz
autodoc.pl: Add N flag
This adds a check that the macro or function name for the pod entry is a legitimate name, as almost all are. If this had been in effect, the bug fixed by the previous commit would not have been necessary. But there are a very few things that are documented that aren't strict names. This adds a flag so that autodoc can be notified to not warn on them. This will allow Devel::PPPort to not have to special case situations like this, which it now does.
Diffstat (limited to 'autodoc.pl')
-rw-r--r--autodoc.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/autodoc.pl b/autodoc.pl
index 43027a7213..c0643585d0 100644
--- a/autodoc.pl
+++ b/autodoc.pl
@@ -107,9 +107,12 @@ HDR_DOC:
next FUNC;
}
if ($in =~ /^=for\s+apidoc\s+(.*?)\s*\n/) {
- my $proto = $1;
+ my $proto_in_file = $1;
+ my $proto = $proto_in_file;
$proto = "||$proto" unless $proto =~ /\|/;
my($flags, $ret, $name, @args) = split /\s*\|\s*/, $proto;
+ warn ("'$name' not \\w+ in '$proto_in_file' in $file")
+ if $flags !~ /N/ && $name !~ / ^ [_[:alpha:]] \w* $ /x;
my $docs = "";
DOC:
while (defined($doc = $get_next_line->())) {