This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Add texi2pod.pl support for @multitable (was Re: Coldfire doc glitch)
- From: Richard Sandiford <richard at codesourcery dot com>
- To: François-Xavier Coudert <fxcoudert at gmail dot com>
- Cc: "GCC Development" <gcc at gcc dot gnu dot org>
- Date: Tue, 06 Feb 2007 10:05:03 +0000
- Subject: Add texi2pod.pl support for @multitable (was Re: Coldfire doc glitch)
- References: <19c433eb0702060006u25bdd886lbcc49bdbbb8574b@mail.gmail.com>
"François-Xavier Coudert" <fxcoudert@gmail.com> writes:
> I found the following in my build logs, and thought it was worth
> reporting to you. Although I don't speak texinfo, the lines in
> questions are the ones introduced by your ColdFire 9/63 patch
> (commited as rev. 120713):
>
> perl /home/fxcoudert/gfortran_nightbuild/trunk/gcc/../contrib/texi2pod.pl
> /home/fxcoudert/gfortran_nightbuild/trunk/gcc/doc/invoke.texi >
> gcc.pod
> @table ended by @end multitable at line 10424
> make[3]: [gcc.pod] Error 9 (ignored)
Ugh, thanks for the heads-up. This patch adds some rudimentary
support for @multitable. As far as I know, perldoc doesn't have
anything equivalent to multi-column tables, so I just treated them
as itemized lists and used ":" as a column separator. The gcc.1
rendering doesn't look as bad as you might think.
Tested by examining the gcc.1 output. OK to install?
Richard
contrib/
* texi2pod.pl: Handle @multitable.
Index: contrib/texi2pod.pl
===================================================================
--- contrib/texi2pod.pl (revision 121640)
+++ contrib/texi2pod.pl (working copy)
@@ -162,6 +162,8 @@ while(<$inf>) {
} elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
$_ = "\n=back\n";
$ic = pop @icstack;
+ } elsif ($ended eq "multitable") {
+ $_ = "\n=back\n";
} else {
die "unknown command \@end $ended at line $.\n";
}
@@ -278,6 +280,12 @@ while(<$inf>) {
$endw = "enumerate";
};
+ /^\@multitable\s.*/ and do {
+ push @endwstack, $endw;
+ $endw = "multitable";
+ $_ = "\n=over 4\n";
+ };
+
/^\@([fv]?table)\s+(\@[a-z]+)/ and do {
push @endwstack, $endw;
push @icstack, $ic;
@@ -297,6 +305,16 @@ while(<$inf>) {
$_ = ""; # need a paragraph break
};
+ /^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
+ @columns = ();
+ for $column (split (/\s*\@tab\s*/, $1)) {
+ # @strong{...} is used a @headitem work-alike
+ $column =~ s/^\@strong{(.*)}$/$1/;
+ push @columns, $column;
+ }
+ $_ = "\n=item ".join (" : ", @columns)."\n";
+ };
+
/^\@itemx?\s*(.+)?$/ and do {
if (defined $1) {
# Entity escapes prevent munging by the <> processing below.