summaryrefslogtreecommitdiff
path: root/autodoc.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-05-29 15:50:45 -0600
committerKarl Williamson <khw@cpan.org>2019-05-30 18:13:29 -0600
commit8b5ff1772f001e0c74deba87357786064655fa3a (patch)
tree67b6b189c52ac074b9f9315ae8eedef3589fcd15 /autodoc.pl
parentd7cc320995afaaf4d9c90b37e578f1fe79068198 (diff)
downloadperl-8b5ff1772f001e0c74deba87357786064655fa3a.tar.gz
autodoc.pl: Make 's' flag independent of 'n'
The 's' flag is used by autodoc.pl to add a semi-colon to the end of a usage example. This commit allows that to happen even if the macro has parameters. This allows two macros in scope.c to be properly documented. Previously they weren't, and caused warnings in Devel::PPPort as a result. This commit adds documentation to embed.fnc for the 's' flag, which has long existed, undocumented.
Diffstat (limited to 'autodoc.pl')
-rw-r--r--autodoc.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/autodoc.pl b/autodoc.pl
index 2d56e81b79..9a2e9ec44e 100644
--- a/autodoc.pl
+++ b/autodoc.pl
@@ -221,11 +221,10 @@ removed without notice.\n\n$docs" if $flags =~ /x/;
print $fh "=item $name\nX<$name>\n$docs";
if ($flags =~ /U/) { # no usage
+ warn("U and s flags are incompatible") if $flags =~ /s/;
# nothing
} else {
- if ($flags =~ /s/) { # semicolon ("dTHR;")
- print $fh "\t\t$name;";
- } elsif ($flags =~ /n/) { # no args
+ if ($flags =~ /n/) { # no args
print $fh "\t$ret\t$name";
} else { # full usage
my $n = "Perl_"x$p . $name;
@@ -271,6 +270,7 @@ removed without notice.\n\n$docs" if $flags =~ /x/;
if ($long_args) { print $fh "\n", substr $indent, 0, -4 }
print $fh ")";
}
+ print $fh ";" if $flags =~ /s/; # semicolon "dTHR;"
print $fh "\n\n";
}
print $fh "=for hackers\nFound in file $file\n\n";