public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix @multitable handling in texi2pod.pl
@ 2019-12-06 10:17 Richard Sandiford
  2019-12-06 22:06 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2019-12-06 10:17 UTC (permalink / raw)
  To: gcc-patches

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.

Tested by making sure that it doesn't change the current gcc.pod output,
but fixes the problems mentioned above when the new @multitable is added.
OK to install?

Richard


2019-12-05  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.

Index: contrib/texi2pod.pl
===================================================================
--- contrib/texi2pod.pl	2019-03-08 18:14:23.345019203 +0000
+++ contrib/texi2pod.pl	2019-12-06 10:15:24.968809478 +0000
@@ -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";

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix @multitable handling in texi2pod.pl
  2019-12-06 10:17 Fix @multitable handling in texi2pod.pl Richard Sandiford
@ 2019-12-06 22:06 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2019-12-06 22:06 UTC (permalink / raw)
  To: Richard Sandiford, gcc-patches

On Fri, 2019-12-06 at 10:17 +0000, Richard Sandiford wrote:
> 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.
> 
> Tested by making sure that it doesn't change the current gcc.pod
> output,
> but fixes the problems mentioned above when the new @multitable is
> added.
> OK to install?
> 
> Richard
> 
> 
> 2019-12-05  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.
OK
jeff
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-06 22:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 10:17 Fix @multitable handling in texi2pod.pl Richard Sandiford
2019-12-06 22:06 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).