Files
pcre2/maint/CheckMan
Carlo Marcelo Arenas Belón 93e4b505fd maint: introduce LintMan to aid on tracking/updating values and fix pcre2limits.3 for the correct name length (#776)
Allow tagging the documentation with a `#define` value that could
be then updated programmatically.

Update the value for MAX_NAME_SIZE in pcre2limits.3 that was missing
since ced3b0f0 (Increase name length to 128, 2024-03-11) and while
at it, improve on its description and add a tag for a related
variable.

For completeness, add also a tag to the same value in pcre2pattern.3
and the configuration for VMS that was missing since 6c670c78
(Update overlooked cmake update of name size to 128, 2024-03-11) and
add it to UpdateAlways so it can be used in a developer tree.
2025-08-29 11:38:30 +01:00

79 lines
1.7 KiB
Perl
Executable File

#! /usr/bin/perl
# A script to scan PCRE2's man pages to check for typos in the control
# sequences. I use only a small set of the available repertoire, so it is
# straightforward to check that nothing else has slipped in by mistake. This
# script should be called in the doc directory.
$yield = 0;
while (scalar(@ARGV) > 0)
{
$line = 0;
$file = shift @ARGV;
open (IN, $file) || die "Failed to open $file\n";
while (<IN>)
{
$count = 0;
$line++;
if (/^\s*$/)
{
printf "Empty line $line of $file\n";
$yield = 1;
}
elsif (/^\./)
{
if (!/^\.\s*$|
^\.B\s+\S|
^\.TH\s\S|
^\.SH\s\S|
^\.SS\s\S|
^\.TP(?:\s?\d+)?\s*$|
^\.br\s*$|
^\.rs\s*$|
^\.sp\s*$|
^\.nf\s*$|
^\.fi\s*$|
^\.P\s*$|
^\.PP\s*$|
^\.\\"(?:\ HREF)?\s*$|
^\.\\"\sDEFINE\s\w+$|
^\.\\"\sHTML\s<a\shref="[^"]+?">\s*$|
^\.\\"\sHTML\s<a\sname="[^"]+?"><\/a>\s*$|
^\.\\"\s<\/a>\s*$|
^\.\\"\sJOINSH\s*$|
^\.\\"\sJOIN\s*$/x
)
{
printf "Bad control line $line of $file\n";
$yield = 1;
}
}
elsif (/\\[^ef&]|\\f[^IBP]/)
{
printf "Bad backslash in line $line of $file\n";
$yield = 1;
}
while (/\\f[BI]/g)
{
$count++;
}
while (/\\fP/g)
{
$count--;
}
if ($count != 0)
{
printf "Mismatching formatting in line $line of $file\n";
$yield = 1;
}
}
close(IN);
}
exit $yield;
# End