Subject: | podchecker fails to detect superfluous =cut directive |
In the Parrot distribution we have a variety of tests checking the syntax of documentation
written in the POD format. One of them, t/codingstd/pod_syntax.t, calls a function called
file_pod_ok() which is ultimately based on Pod::Simple:
# Pulled from Test::Pod
sub file_pod_ok {
my $file = shift;
my $checker = Pod::Simple->new;
$checker->output_string( \my $trash ); # Ignore any output
$checker->parse_file($file);
return !$checker->any_errata_seen;
}
pod_syntax.t reports which files have POD syntax errors, but doesn't tell you what the errors
are. Instead, it advises you to use 'podchecker' to detect and correct the errors.
Recently, pod_syntax.t reported an error in a number of files. The attached file, TGE.pir, is a
slimmed-down version of such files that displays the errant behavior. But when I ran this
file through 'podchecker', no error was reported.
The problem: 'podchecker' fails to detect the superfluous '=cut' directive near the end of the
file. This extra =cut is what pod_syntax.t reports, as evinced by the fact that when I delete
the extra =cut, pod_syntax.t reports no errors.
Could podchecker be revised to detect superfluous =cut directives?
Thank you very much.
Jim Keenan
Subject: | TGE.pir |
# Copyright (C) 2005-2009, Parrot Foundation.
=head1 NAME
TGE - A tree grammar engine.
=head1 SYNOPSIS
# define a grammar leaf.tg
transform min (Leaf) :language('PIR') {
$P1 = getattribute node, "value"
.return ($P1)
}
...
.end
=head1 DESCRIPTION
TGE is a tool for transforming trees. Think of it as a good
old-fashioned substitution, but instead of taking and returning strings,
it takes and returns trees.
=cut
.namespace [ 'TGE' ]
.sub '__onload_first' :load
# use other modules
load_bytecode 'PGE.pbc'
load_bytecode 'PGE/Util.pbc'
.end
=cut
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: