]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix @multitable handling in texi2pod.pl
authorRichard Sandiford <richard.sandiford@arm.com>
Sat, 7 Dec 2019 09:57:04 +0000 (09:57 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 7 Dec 2019 09:57:04 +0000 (09:57 +0000)
While trying out Dennis's Armv8.6-A patch, I noticed that texi2pod.pl
didn't handle the new @multitable correctly.  There were two problems:

(1) @multitables nested in other @tables inherited the @item type from
    the enclosing @table.  Since the new @multitable is in a @table @samp,
    we applied @samp markup to the @multitable @items.  This in turn
    meant that it captured the @tab separator in the @item markup.

    Fixed by pushing an empty item code onto the stack.

(2) We didn't handle @headitem.  Fixed by enclosing it in italics,
    like we do for section headings.  This causes it to be underlined
    in the man output.

2019-12-07  Richard Sandiford  <richard.sandiford@arm.com>

contrib/
* texi2pod.pl: Handle @headitems in @multitables, printing them
in italics.  Push an empty item code onto the stack.

From-SVN: r279074

contrib/ChangeLog
contrib/texi2pod.pl

index db1d6fbdb19484a5e56d43d73978024104877d49..b1910a642102f1d0c3c53ad35240028f3fcaf839 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-07  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * texi2pod.pl: Handle @headitems in @multitables, printing them
+       in italics.  Push an empty item code onto the stack.
+
 2019-11-13  Janne Blomqvist  <jb@gcc.gnu.org>
 
        * download_prerequisites: Use http instead of ftp for downloading.
index 91bdbb5cea933d0381f2924ab94490fca31d5800..608dff42415f79e08212a7783abb1de5bca832a6 100755 (executable)
@@ -164,6 +164,7 @@ while(<$inf>) {
            $ic = pop @icstack;
        } elsif ($ended eq "multitable") {
            $_ = "\n=back\n";
+           $ic = pop @icstack;
        } else {
            die "unknown command \@end $ended at line $.\n";
        }
@@ -288,7 +289,9 @@ while(<$inf>) {
 
     /^\@multitable\s.*/ and do {
        push @endwstack, $endw;
+       push @icstack, $ic;
        $endw = "multitable";
+       $ic = "";
        $_ = "\n=over 4\n";
     };
 
@@ -312,11 +315,13 @@ while(<$inf>) {
        $_ = "";        # need a paragraph break
     };
 
-    /^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
+    /^\@(headitem|item)\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
        @columns = ();
-       for $column (split (/\s*\@tab\s*/, $1)) {
+       $item = $1;
+       for $column (split (/\s*\@tab\s*/, $2)) {
            # @strong{...} is used a @headitem work-alike
            $column =~ s/^\@strong\{(.*)\}$/$1/;
+           $column = "I<$column>" if $item eq "headitem";
            push @columns, $column;
        }
        $_ = "\n=item ".join (" : ", @columns)."\n";